A word of caution

Philipp Tomsich mac at mars.zserv.tuwien.ac.at
Wed Apr 29 15:44:06 PDT 1998


On Thu, 30 Apr 1998 njh at cs.monash.edu.au wrote:

> On Wed, 29 Apr 1998, Sam Lantinga wrote:
> 
> > Is there any situation where a program might want to do CPU intensive
> > tasks and handle events asynchronously?
> I would have thought that the MacOS solution was the simplest, just make
> the main thread the event thread - if you want to do something big, make
> your own thread!

This solution may sound elegant Nathan, but it usually makes things worse:
This means there's no elegant way of feeding events to the worker
threads... you'll need synchronization & thus add unnecessary overhead. In
the end you might end up with something like OpenSTEP (ie. the display
server and the app-kit are not thread-safe there).

We should rather decide what we what: Do we really need async events? If
not, how can we simplify the mechanisms & what are the drawbacks. If Sam
takes the async events out now, there's probably be no way back, as future
code may depend on certain behaviour.

I personally don't consider async events necessary in SDL, as the type of
application (primarily games) usually process all their events centrally.


cheers.
--phil.




More information about the SDL mailing list