On 10/11/2013 06:38 AM, Lars Bergstrom wrote:
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.

Unless there is a serious bug in the runtime (always possible), it's true that only the compositor task should be executing on the main thread, and every other task will be executing on other threads. There are message passing patterns that can cause the scheduler to not utilize available threads correctly, so you could simply be hitting a bad case for the scheduler. I'd love to have those test cases.

I'm curious if servo is exhibiting actual parallelism at all right now, or if this is a preexisting problem.


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

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

Reply via email to