All tasks should not be scheduled to run on the main thread: only the toplevel 
one where the compositor runs. That design ensures the windowing system calls 
(via glut and glfw) are performed on same system thread where the window was 
created and the windowing system was initialized, which is required by some 
windowing systems.

I wrote up a test that spawns a task that performs some work, printing 
concurrently with the top-level task that was started on the main thread and 
its output appears interleaved:
https://gist.github.com/larsbergstrom/6933164

How can I reproduce the behavior that you are seeing in servo? Where did you 
add tasks that do not have the behavior you were expecting? Is there a branch 
in your github repo that we can look at?

One possible issue I can imagine is that if the main thread started running 
another task due to the compositor thread sleeping, that task would block the 
compositor thread from running again because the compositor is bound to the 
main thread. But, when I last talked with Brian about that scenario, he 
mentioned that the main thread is normally not used by the Rust runtime and so 
the compositor should be the only task run on that system thread.

Thanks,
- Lars

On Oct 11, 2013, at 3:22 AM, 최영일 <duddlf.c...@samsung.com> wrote:

> 
> Dear all,
> 
> In order to test some parallel idea, I added a few tasks to layout task in 
> servo however I found that the tasks what I added did not run in 
> concurrently. they run with serialized. It looks to me that all tasks was 
> bounded at single thread and scheduled with std::rt::start_on_main_thread.
> 
> I changed servo.rc not to be scheduled with std::rt::start_on_main_thread 
> like changing #[start] to #[main], removing std::rt::start_on_main_thread in 
> entry point of servo.rc and running compositing task in entry point to see 
> correct output in display then I found the tasks what I added run in 
> concurrently.
> 
> Question is 
> - Is there any special reason that all tasks are scheduled in 
> std::rt::start_on_main_thread ?
> 
> Regards,
> Young
> _______________________________________________
> dev-servo mailing list
> dev-servo@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-servo

_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to