Re: [AD] END_OF_MAIN removal patch for msvc

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


On November 18, 2008, Peter Wang wrote:
> On 2008-11-18, Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx> wrote:
> > On November 18, 2008, Peter Wang wrote:
> > > Why not my suggestion, which is for the user to give over the main
> > > thread to Allegro, which must happen one way or another on Mac OS X. 
> > > In return, Allegro starts a function of the user's choosing in a new
> > > thread.  That's it.  No tricks, no name mangling, no hidden symbols, no
> > > polling calls everywhere,
> >
> > If the user does his job, theres one polling call ;)
>
> It's not always the case that the program has only one main loop.
>
> > > no reworking your program to work as a non-blocking callback.
> >
> > Rework what? This is a new lib with a new api. We can do whatever we
> > want.
>
> It's still a pain to write your program in terms of a state machine.
> That's why threads (preemptive or not) were invented.
>
> > But this isn't a bad idea either. something like the following?
> >
> > int main(int argc, char **argv)
> > {
> > 	// setup stuff
> > 	....
> > 	return al_run(my_main, argc, argv);
> > }
>
> Right.  See my message dated "Date: Tue, 18 Nov 2008 12:36:51 +1100"
> where I take it a little further, where the "setup stuff" actually goes
> into my_main.
>
> > this way we get the params, and can get rid of END_OF_MAIN, and any
> > associated hacks.
> >
> > So long as running the user's code in a separate thread causes less (and
> > less serious) problems than the current and other proposed setups I'm all
> > for it.
>
> We'd only run the user's code in a new thread if it's actually
> necessary.  That means Mac OS X, where we already do that.

Why not make it consistent? If allegro has to fire off a thread /anyhow/ might 
as well make it the same code.

> Peter
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge Build the coolest Linux based applications with Moblin SDK & win
> great prizes Grand prize is a trip for two to an Open Source event anywhere
> in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/


-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




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