It hands control back to the Scheduler, as you expect, but the main context is no longer scheduled to run, so it will never return. Instead of calling `yieldto`, you can call `schedule` to start the task lazily. (or I think you could instead call `schedule(current_task())` just before the `yieldto` call so that your task is still runnable by the Scheduler)
On Sat, Dec 21, 2013 at 5:33 AM, Spencer Russell <[email protected]> wrote: > When a Task waits does it block the whole Julia thread, or does it return > control to the scheduler to schedule in other tasks? See the following test > code: > > function task_test() > function task() > info("started task") > wait() > end > info("about to start task") > yieldto(Task(task)) > info("task yielded back to main context") > end > > I would expect the output of running task_test() to be > > about to start task > started task > task yielded back to main context > > but instead it seems that when the task waits, it doesn't hand control back > to the main context. I'm running this from the REPL, if that makes any > difference. > > -s
