Fw: SDL_thread

The best way to do something like this is to create a
pool of threads and give them something to do. After
they are done they return to the pool.> ----- Original Message -----

From: “Uriah Liggett” <game_dev at hotmail.com>
To:
Sent: Monday, April 23, 2001 10:53 PM
Subject: [SDL] 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

Right; also note that on any OS with a remotely sensible scheduler design,
sleeping threads will cause virtually or even absolutely no overhead.

In fact, many server applications entirely depend on this, and may have tens
of thousands of threads lying around, waiting for a connection or whatever to
take care of. A sersious OS is designed to use threads that way, as it’s a
very nice way of dealing with huge numbers of partially independent tasks.

//David

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------> http://www.linuxaudiodev.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |--------------------------------------> david at linuxdj.com -'On Tuesday 24 April 2001 10:51, Paulo Pinto wrote:

The best way to do something like this is to create a
pool of threads and give them something to do. After
they are done they return to the pool.