[AD] OSX END_OF_MAIN musings

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I've just been thinking. The reason we haven't been able to get rid of END_OF_MAIN on OSX is because the input thread needs to be the main thread, and we'd run the main program from a secondary thread, right? END_OF_MAIN constructs the real main function, starts a second thread with _mangled_main, and leaves the main thread to grab input and stuff. Basically swapping the timer and main threads compared to other OS's.

How efficient would it be to use fork() in this case? If install_allegro calls fork, it can let the child process continue on as normal, and leave the parent process forever stuck in install_allegro, acting as the polling thread.

I'm not too sure how feasible this is though. I can see concerns about the program's resources being doubled, but perhaps there's a way around that? Or maybe it's not that much of a problem?

Any thoughts/ideas?




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/