[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coroutines / Threads



> Just a query, before I think about re-inventing any wheels.  Is there some
> work that has been done on implementing Oakwood Coroutines or a Threads

Nothing, I'm aware of.

> module for OO2C?  How far from re-entrant does the library appear to be at
> this point?

All the "class" modules (ending with `s') should be fairly clean 
in that no global module data would be used.  Some of the math 
modules use a global error variable which might cause some problems.  
Someone could easily get rid of this and use the proper exceptions 
instead. The In/Out/Err/Log and probably some other modules may not be
reentrant since they use a single resource (ie. the user terminal).
I don't know if this will be a problem since Threads would need
to lock shared resources anyway.  Other modules such as SysClock
would be ok as long as only reads are attempted.  Setting the
system clock will have to be locked.  The "Riders" are probably
reentrant as well since they have no global data.  So it looks like
about 80-90% of the modules are ok.  The Files module may be a
problem since multiple Riders can sit on top of a single resource.
Since these Riders could be in different threads, I believe that
the Files and/or PosixFileDescr may need to implement some
locking.

BTW, I have a vested interested in the threadability of OOC since I
am using it on the BeOS, which has OS-supported threads.

Michael G.