[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: [Factor-talk] os threading locks vocab Phil Dawes Wed Oct 21 14:00:24 2009

Hi Doug,

Doug Coleman wrote:
> 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.

maybe concurrency.osthreads.* ?

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

That sounds really cool, I'll check out the branch.
I was thinking of adding atomic ops to the vm next (in vm/cpu-*.S). Let 
me know if anybody else is about to do this and I'll hold fire. The last 
time I chatted with Slava on IRC he was thinking of implementing a GIL 
as a step on the way to full vm threading so I'm thinking about how that 
could be done.



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!
Factor-talk mailing list