RE: Fw: Re: [AD] messy allegro 5.0 stuff |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Eric Botcazou writes:
> Callbacks are useful (not necessary, like recursive functions are not
> necessary) when you want to do pure asynchronous event processing. Of
> course you could set up your own thread, but why would you want to
> increase again the system overhead ? Input processing is already done
> with threads on most platforms by Allegro, why not simply allow to
> attach to these threads ?
Although, on some platforms the threads were only needed in order to
match the global variable / callback model that Allegro was using.
The Unix code would have been much smaller and simpler if it could
use a polled model, and that would also have hugely simplified some
of the surface locking issues in the Windows port (given entirely
polled input, it would have been possible to do 100% automatic and
efficient surface locking without the user ever needing to be aware
of it).
I don't think it makes a lot of difference either way, though. Whatever
way it goes, some platforms will find that easy while others have to
jump through hoops to emulate it. The really silly thing would be to
try to do both, in which case all platforms would end up jumping through
hoops :-)
--
Shawn