Just curious on threads

What’s everyone else’s encounters with lotsandlots of threads?
I’m currently working on a audio/video capture/playback networked-type
proggy (it’s for work so don’t ask) and it has lots of threads… mostly
because when it was single-threaded it tended to bog down at several
points. (it’s currently at about a dozen active threads)

Anyways, while this is working fine for me under linux, is there anything
special to note about thread number limits or performance drops on other
platforms? (ie: Win/32, MacOS (which version?), and so forth)

G’day, eh? :slight_smile:
- Teunis

PS: MANY kudos to the SDL thread code g. It’s made life much easier…
my current interthread queue system sort of resembles SDL_audio with a few
additions and changes (‘intelligent’ packets, fixed pools of packets, wait
states if pool full (doesn’t tend to remain so) and multiple-thread-send
with single-thread receive (same as SDL_audio :slight_smile:

winterlion wrote:

Anyways, while this is working fine for me under linux, is there anything
special to note about thread number limits or performance drops on other
platforms? (ie: Win/32, MacOS (which version?), and so forth)

Unless I have been decieved, MacOS is not a multithreading OS. I know that
Internet Explorer can load multiple things at once but I believe that is
software based. I am not a Mac head - I don’t know.

    -- David Snopek

At 8:41 Uhr -0600 21.12.2000, David Snopek wrote:

winterlion wrote:

Anyways, while this is working fine for me under linux, is there anything
special to note about thread number limits or performance drops on other
platforms? (ie: Win/32, MacOS (which version?), and so forth)

Unless I have been decieved, MacOS is not a multithreading OS. I know that
Internet Explorer can load multiple things at once but I believe that is
software based. I am not a Mac head - I don’t know.

Any threading is normally software based, even that on Linux/Windows etc.

I guess you meant it is not done at OS level. But on MacOS there is a
thread manager, and threading is done at an OS level, but
unfortunatly it is only cooperative threading :confused:

MacOS X is a completly different OS, it has full “true” threading.

Max–

Max Horn
International C/C++/Internet Development

email: mailto:Max_Horn
web: http://www.quendi.de
phone: (+49) 6151-494890

Organization: KewL STuFf Inc.

winterlion wrote:

Anyways, while this is working fine for me under linux, is there anything
special to note about thread number limits or performance drops on other
platforms? (ie: Win/32, MacOS (which version?), and so forth)

Unless I have been decieved, MacOS is not a multithreading OS. I know that
Internet Explorer can load multiple things at once but I believe that is
software based. I am not a Mac head - I don’t know.

You can do preemptive threading on MacOS now, but the threads can’t call
toolbox functions without some serious mucking about. So forget about an
audio thread.

If the procedure is interrupt-safe, it’s not much of a problem, but if
not…a disaster. Doing this unwittingly leads to immediate thread
termination.

Oh, well…> From: David Snopek

Reply-To: sdl at lokigames.com
Date: Thu, 21 Dec 2000 08:41:27 -0600
To: sdl at lokigames.com
Subject: Re: [SDL] just curious on threads

At 19:38 Uhr -0500 22.12.2000, Darrell Walisser wrote:

Organization: KewL STuFf Inc.

winterlion wrote:

Anyways, while this is working fine for me under linux, is there anything
special to note about thread number limits or performance drops on other
platforms? (ie: Win/32, MacOS (which version?), and so forth)

Unless I have been decieved, MacOS is not a multithreading OS. I know that
Internet Explorer can load multiple things at once but I believe that is
software based. I am not a Mac head - I don’t know.

You can do preemptive threading on MacOS now, but the threads can’t call
toolbox functions without some serious mucking about. So forget about an
audio thread.

Well, AFAIK you cannot do “real” preemptive threading on MacOS
(unless you talk about the Multi Processor API, but this is only
usable if you multiple CPUs IIRC - please correct me if I am wrong).
You can do cooperative threading using the thread manager however.

And you could simulate preemptive threading using interrupts I guess,
but this would be very bad in regards of portability.

In any case, you are certainly right in so far as a parts of the
toolbox are not re-entrant, so you could not use them in preemptive
threads (BTW, preemptive threads once were part of the Thread Manager
a long time ago, but where killed for exactly this reason).

Talking about MacOS X is something completly different - it is a
whole new OS. Yes, OS X does preemptive threading.

If the procedure is interrupt-safe, it’s not much of a problem, but if
not…a disaster. Doing this unwittingly leads to immediate thread
termination.

Yeah…

Max> > From: David Snopek

Reply-To: sdl at lokigames.com
Date: Thu, 21 Dec 2000 08:41:27 -0600
To: sdl at lokigames.com
Subject: Re: [SDL] just curious on threads


Max Horn
International C/C++/Internet Development

email: mailto:Max_Horn
web: http://www.quendi.de
phone: (+49) 6151-494890