Execute a function with a timeout / time limit?

385 views
Skip to first unread message

Robert Feldt

unread,
Jan 13, 2015, 7:42:11 AM1/13/15
to julia...@googlegroups.com
Is there any way to run a function a maximum time without adding additional procs? I now use an implementation based on this StackOverflow answer:


but it requires waiting to add the procs, making sure code loads on all procs etc. Is there some simpler/shorter/quicker way?

Best regards,

Robert Feldt

Isaiah Norton

unread,
Jan 16, 2015, 10:24:56 PM1/16/15
to julia...@googlegroups.com
Have you tried using tasks with start_timer and interrupt?

René Donner

unread,
Jan 17, 2015, 1:39:25 AM1/17/15
to julia...@googlegroups.com
Is there also something like interrupt(task) to selectively kill one of several tasks? I could not find anything in the docs.

Thanks!

Robert Feldt

unread,
Jan 19, 2015, 3:51:41 AM1/19/15
to julia...@googlegroups.com
In this proposal/issue thread it is discussed that this can be achieved via the schedule method but I have not been able to find an example or doc on it:


Thanks,

Robert

René Donner

unread,
Jan 19, 2015, 5:50:14 AM1/19/15
to julia...@googlegroups.com
Thanks for the hint!

I tried to play with the suggestions in that issue, but did not get anywhere (but I dont know anything about the scheduling internals ...)
Reply all
Reply to author
Forward
0 new messages