Re: [AD] public thread API |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: Coordination of admins/developers of the game programming library Allegro <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] public thread API
- From: Elias Pschernig <elias@xxxxxxxxxx>
- Date: Thu, 07 Aug 2008 17:00:09 +0200
On Thu, 2008-08-07 at 22:37 +1000, Peter Wang wrote:
> On 2008-08-06, Elias Pschernig <elias@xxxxxxxxxx> wrote:
> > On Wed, 2008-08-06 at 11:04 +1000, Peter Wang wrote:
> > >
> > > Taking it a bit further, al_create_thread could not just allocate the
> > > space for the thread handle, but call pthread_create. But we would not
> > > actually execute the user's thread function until al_start_thread.
> > > I believe this is useful for cases like:
> > >
> > > T = al_create_thread(thread_func);
> > > do further initialisation, using T
> > > al_start_thread(T);
> > >
> > > Not sure how common it is.
> > >
> >
> > I was thinking about creating the threads first, then you could run them
> > multiple times, then destroy them. (So would not call pthread_create I
> > think.)
>
> Any particular use for that?
>
Well, nothing which couldn't be done in another way as well. But it
would be straightforward to implement using the current internal API,
while I have no idea how calling pthread_create without running the
function would be done with it.
--
Elias Pschernig <elias@xxxxxxxxxx>