[AD] [ alleg-Bugs-2418979 ] detached threads |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Bugs item #2418979, was opened at 2008-12-12 12:18
Message generated for change (Comment added) made by tjaden
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=2418979&group_id=5665
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: 4.9
Status: Open
Resolution: None
Priority: 1
Private: No
Submitted By: Peter Wang (tjaden)
Assigned to: Elias Pschernig (elias)
Summary: detached threads
Initial Comment:
Consider adding support for detached threads (not requiring al_join_thread nor al_destroy_thread).
http://www.allegro.cc/forums/thread/598582
----------------------------------------------------------------------
>Comment By: Peter Wang (tjaden)
Date: 2009-08-20 11:02
Message:
Yes, I suppose that makes sense. I don't mind if you commit it. Maybe one
day we can expose a detach function for the normal API.
----------------------------------------------------------------------
Comment By: Elias Pschernig (elias)
Date: 2009-08-20 10:18
Message:
Yes, it's a different view. For normal threads, you create it, start it,
then at some point join it and destroy it.
This new function simply would let you "run" a function in another thread.
With no stuff at all to setup, just very easy to use.
----------------------------------------------------------------------
Comment By: Peter Wang (tjaden)
Date: 2009-08-20 09:21
Message:
I would prefer to retain the distinction between creating and starting a
thread. So you can create a thread, set up some more stuff, *then* start
the
thread. If some setup fails you can abort the thread, which is still
waiting
in the trampoline.
Your first patch had the problem of passing the ALLEGRO_THREAD handle to
the
thread func when it was already freed, I think. That can probably just
be
delayed.
----------------------------------------------------------------------
Comment By: Elias Pschernig (elias)
Date: 2009-08-20 01:23
Message:
Actually, there was no reason to ever give a thread handle for the thread
to the user. New patch attached.
----------------------------------------------------------------------
Comment By: Elias Pschernig (elias)
Date: 2009-08-19 23:29
Message:
Attached patch is a try at implementing this.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=2418979&group_id=5665