Re: [Alephmodular-devel] Detangling/de-Mac-ifying
Status: Pre-Alpha
Brought to you by:
brefin
From: Chris P. <sf...@ma...> - 2005-05-19 01:01:33
|
On May 18, 2005, at 8:36 AM, Woody Zenfell III wrote: > Also a couple notes - I'm pretty sure that in Mac OS 9-land, VBL stuff > (and other "interrupt" sort of routines, like network-packet-received) > run to completion before pretty much any other code can run (certainly > before "main loop" code can run). On the other hand, note that the > main code could be preempted at pretty much any time for interrupt > tasks. (IIRC.) After reading through the document, I think I have a pretty good impression of how it's supposed to work, and my impression is that we don't have to worry about the "run to completion" part of the threads. It seems that the only way for the input_controller thread to interact with other threads is through the action queues, and Marathon's behaviour is well-defined for what to do when varying amounts of data are in the queues; all we would get by running the interrupts to completion would be a "more likely" chance of getting flags on the first poll. The circular queue also makes sense to me now. Upon consideration, I would expect that the loss of cycles due to mutex locking/unlocking would probably be greater than the loss due to false negatives - pretty small, but every bit counts. I'll of course put in my usual "make it a class!" line, since if there's a CActionFlags class, sticking a mutex in at a later date would be much easier. Random side note - glancing through the code, there are plenty of #define's still around. Converting them to const's and inlined functions might be a good idea for the future. Of course, many are things which MML is used to define in A1, so their final implementation might not be constants. But this is random and not the subject of this email. - Chris Pickel |