Hi Slava,

Slava Pestov wrote:
> No native mutex is needed if you have a pair of pipes between every
> two VMs that need to communicate. Then, one VM thread writes to the
> pipe, another VM thread reads from it. Since a VM thread is so
> heavy-weight (it has its own data heap) opening a handful of pipes is
> nothing.
> 

I thought about the n^2 pipes option, but thought that the bootstrap 
would be a bit of a pita: Each time a new vm starts all the others have 
to coordinate and listen on new pipes.

The bootstrap of the native mutex approach seems simpler: The parent vm 
passes its pipe send handle and mutex to the child, which then replies 
through the pipe with it's handles on initialisation .

Of course the native lock scheme would still need lightweight locks in 
addition to prevent the race condition where two coop threads try to 
lock the same native mutex.

On a side note something just occurred to me: Should my native lock 
vocab always also acquire lightweight locks, or are there situations 
when a native lock is needed but not a lightweight one?

Cheers,

Phil


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to