Phil,

I think it makes sense to totally separate out all of the new  
threading from the green threads implementation like we do for native/ 
libc io so we can bootstrap with either one until all of the issues  
are resolved.  The current API can probably be a starting point, but I  
think the implementation will have to completely change for native  
threads.

I made a new branch "startup" that renamed add-init-hook to add- 
startup-hook and added shutdown hooks where it made sense.  The boot- 
quotation is now run inside a with-destructors, so startup hooks can  
call &dispose to avoid adding shutdown hooks where disposables are  
created.  I've only added a couple shutdown hooks for things like  
cleaning up Winsock resources.

The exit primitive is now called (exit) and the exit word calls  
shutdown hooks before exiting.  One problem with this approach is that  
the with-destructors cleanup gets denied by the call to (exit) since  
the cleanup will never get a chance to run.  I added a shutdown hook  
that cleans up any global destructors to handle this case, but maybe  
there's a better solution?  Anyway, it's a pretty good start and it  
should get merged within the next few days.  Just wanted to give you a  
heads up so that you don't start on a similar project.

Doug

On Oct 21, 2009, at 8:38 AM, Phil Dawes wrote:

> Hi Slava,
>
> I've written initial os-thread mutex and semaphore FFIs in
> extra:concurrency.locks.unix and concurrency.locks.windows, and was  
> just
> about to wrap it together into a unified api when I realised
> concurrency.locks was already used for cooperative threads.
>
> - Should there be a totally separate concurrency package for os  
> threads?
>
> - From an API perspective do you plan to distinguish between  
> cooperative
> and os-threads in the brave new factorMT world?
>
> 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


------------------------------------------------------------------------------
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