Re: [AD] Allegro main function in separate library

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


On Tue, 2010-01-26 at 13:21 -0500, Evert Glebbeek wrote:

> The fact that magic main is needed on OS X was, I think, not
> immediately obvious. I don't quite remember when A4's OS X port was
> announced, but I seem to recall that at the time it was not obvious
> how to get around the requirement of running the message queue in the
> main thread.

To be honest, I'm not 100% sure that there isn't a way to deliver the
events to something besides the main thread. Objective-C itself doesn't
seem to give special treatment to any thread. And the tests which were
conducted back then (by you and Peter Hull I think) just showed that the
system messages wouldn't arrive - but never why they didn't arrive. And
I found out the same thing while making the initial prototype of the
iphone port - only if I had all of the app delegate stuff in the main
thread things would work. But I never understood why they would stop
working if i moved everything to another thread.

This just means, if an OSX and objective-C and threading expert spends a
few hours looking at this, there is a chance we can remove the
main-macro even under OSX. But the way things are set up now, this
wouldn't require any API changes, A5 code would keep working without a
change and if recompiled the main() simply would be the real main
instead of a macro.

> Anyway. Magic main is gone for all systems except for OS X, where it
> can be easily disabled (which was not the case in A4). I'd say all's
> well. :)
> 

Yes, great work - now I can finally make my Python wrapper work under
OSX :)

-- 
Elias Pschernig <elias.pschernig@xxxxxxxxxx>





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