Re: [AD] public thread API

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


On Wed, 2008-08-06 at 08:17 +0100, Peter Hull wrote:
> The 'deferred start' is useful if you're creating two or more threads
> that communicate with each other, then you can set them both up before
> they start running.
> 
> As far as I can see this API is a wrapper/renaming of pthreads. It's
> good to provide this as I imagine there might be problems if someone
> uses a different thread library alongside what Allegro is using
> internally. I've never used threads in a game before but maybe we
> could have a think about possible uses and provide an API which is
> more helpful for game programming.

Immediate use-cases I can see in games:

- Load you game data in a separate thread, so your user interface can be
responsive while data are loading.

- Wait for network data in a separate thread.

- Split your random level creation/3d mesh preprocessing/whatever else
you might do and takes a long time into several threads, so it will run
a lot faster on multi-cores.

-- 
Elias Pschernig <elias@xxxxxxxxxx>





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