[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Virtual Hosting and the FHS



On Sat, 14 Jul 2001, Russell Coker wrote:

> Most C programmers don't know how to write threading code.  Of those who do
> most don't know how to do it properly.

I know you weren't limiting yourself to C programmers, I've seen the same
(in abundance) for ASM (370), PL/X (IBM internal), etc.

> Threads are not just like processes.  One significant difference between
> threads and processes is that all memory and all file descriptors are shared.
> So after a thread is started the parent thread can't free any memory that the
> child is likely to use, all memory areas that are to be written to must be
> duplicated or locked.  File handles can't be closed without great
> consideration.  Most correctly working fork() based code will fail when
> converted to threads because of these issues.  Some such code will have race
> conditions subtle enough that they may not be fully debugged for years...

Indeed, I spent ~3 years of ~80hr weeks to add parallel extensions to the
Fortran language and libraries...  Had a lot of fun with an OS with only
processes (MVS/VM) - we did threads by caching processes - made I/O, memory
management etc a real pain... We had to continually lie to and subterfuge
the OS

> Another issue is that of debugging.  In multi-threaded programs the primary
> thread generally does little work.  However when a SEGV condition occurs the
> core dump is of the stack of the primary thread, and the cause of process
> termination is listed as "signal 9".  This makes vendors of commercial
> software refuse to examine such core files (they say that the user did kill
> -9).

I've used *ONE* debugging tool that I liked for multi-process debugging, and
using it to handle threads was a nightmare...  it was asm only, and cost
a bundle (XDC, by David Cole & co).  I wouldn't be happy about debugging with
what little I've seen of current debugging tools.

Programming and debugging in threads still seem to be a wizard mode task,
not one to be taken lightly (for that way lie madness).

> I am in no hurry to convert production servers to Apache 2.0 unless I can
> turn off all thread functionality.  However I'll convert my laptop ASAP as I
> like playing with new experimental things on it.  ;)

A well reasoned responce, I like my sandboxes to be bleading edge - but I'm
much more cautious with something I must support users (and especially lusers)
on.
-- 
Rick Nelson
Feel free to contact me (flames about my english and the useless of this
driver will be redirected to /dev/null, oh no, it's full...).
(Michael Beck, describing the PC-speaker sound device)



Reply to: