SDL_thread

Hello,
Can someone tell me about how the creation of a thread using SDL_thread
compares in speed to something like an add or a function call? Is it
magnitudes higher, or multiple magnitudes? Would it be feasible to have a
threads creating and destroying every redraw in an OpenGL application, if
they were doing the geometry interpolation (over 25,000 triangles each
draw). Would it be better to just have set threads that always exist, and
only wake up when I set a global variable to tell it to work on a certain
piece of data? That way there’s little to no thread creation/deletion
overhead.

Thanks ahead of time._________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

“Uriah Liggett” <game_dev at hotmail.com> writes:

Hello,
Can someone tell me about how the creation of a thread using
SDL_thread compares in speed to something like an add or a function
call? Is it magnitudes higher, or multiple magnitudes? Would it be
feasible to have a threads creating and destroying every redraw in
an OpenGL application, if they were doing the geometry interpolation
(over 25,000 triangles each draw). Would it be better to just have
set threads that always exist, and only wake up when I set a global
variable to tell it to work on a certain piece of data? That way
there’s little to no thread creation/deletion overhead.

You definitely want to use some kind of thread pooling or some similar
architecture. The overhead is way to high to create / destroy threads
all the times. Especially since it most likely isn’t even necessary or
of any benefit to do so.–
[ Below is a random fortune, which is unrelated to the above message. ]
unfair competition, n.:
Selling cheaper than we do.

Can someone tell me about how the creation of a thread using SDL_thread
compares in speed to something like an add or a function call? Is it
magnitudes higher, or multiple magnitudes?

multiple magnitudes