... a comment on threads....

Teunis Peters (teunis@usa.net)
Tue, 22 Jul 1997 22:34:05 -0600 (MDT)


On Tue, 22 Jul 1997, Theodore Y. Ts'o wrote:

> (Insert standard claim about why I think threads are a bad idea for most
> application programs; there are plenty of kernel programmers have a hard
> time writing thread-safe kernel code --- and we expect *application*
> programmers to be able to get this stuff right? It's like handing a
> loaded .45 to a chimpanzee and hoping he won't shoot himself or others
> while he's playing with it. :-)
>
> (Yes, I know sometimes you need threads for performance reasons; but you
> better have someone who really knows what they are doing, and the times
> when you need threads are much rarer than you think.)

100% of time with realtime or Java-style coding.
A real performance boost to X [if done properly].
though if someone NEEDS threads [other than Java], they play with fire!

[speaking of one who LIKES playing with fire :]

You don't solve this by preventing application programmers from coding
threads.... you solve this by having thread-safe libraries or by making
thread creation/control very esoteric :)

So where do I find out how to make my multithreaded X/Java/OpenGL system
SMP-safe? <grin>
[idle boast - it can handle a couple of X/OpenGL commands and it's Java
interface is pure native-code only... and incomplete at that].

Come to think of it, there's something of a lack of info on how to
thread-safe an app in linux (though the Thread-FAQ was very nice :)...
.... or maybe I should just ask : Is there anything I should know about
dealing with threads, locks, et al when dealing with SMP linux?
[I _DON'T_ have an SMP machine]

TIA and have a nice day :)
- Teunis