On Tuesday, July 10, 2012 6:06:22 PM UTC-6, Ben Noordhuis wrote:
>
> On Wed, Jul 11, 2012 at 12:56 AM, Nathan Sobo <nat...@github.com> wrote: 
> > I'm glad to hear you're thinking about this. What's the mutual exclusion 
> > situation look like? When I call functions that modify the uv_loop_t 
> struct 
> > from another thread, will I need to synchronize that access, or would 
> that 
> > synchronization be done internally? Are there any branches started on 
> this? 
> > 
> > Thanks for your reply. 
>
> You need to handle synchronization yourself. 
>  
>
I should mention that libuv does not support manipulating an event 
> loop from more than one thread. Calling e.g. uv_run_once(loop) from 
> alternately thread #1 and thread #2 - even with proper locking in 
> place - won't work. That's mostly a uv-win limitation but uv-unix 
> makes no guarantees either. 
>

I wouldn't want to call run_once from two different threads in this case. I 
would just want to start watches and execute callbacks on the renderer 
thread but do the looping and blocking on an auxiliary thread so as not to 
block the application event loop on the renderer thread.
 

>
> You can have multiple event loops, one for each thread, however. 
>

I notice a lot of use of default_loop in Node. So I guess it still assumes 
a single loop. This is looking like it might involve a lot of changes :-/
 

>
> Re: branches: no, not yet. I'm working on a couple of other features 
> first. 
>

Okay... not sure we're quite on the same page, but that's okay. Perhaps 
this is not a fruitful path to attempt right now. Thanks again!

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to