[H-GEN] Apache segfaulting... how to debug

Raymond Smith raymond at humbug.org.au
Sat Jul 19 03:56:56 EDT 2003


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

This post is intented to give an alternative view to the
'non programmers' in HUMBUG. I'm not really interested in
a debate: but if you are, please send your follow-ups to
DSIG.

Andrae Muys said:
> David Jericho wrote:
>>>    * Programs using multithreading "for good performance" are
>>>      almost always broken by design and should be discarded
>>>      immediately.
>> I don't agree, but then again, I'm thinking multiprocessor machines. I
>> guess it all comes down to what exactly you define as a "thread of
>> execution".
>
> The only reasonable interpreation of "thread" is "OS Thread"; as
> 'library threads' are only a programming abstraction and therefore
> irrelevant to any discussion of performance[0].

Very true.

However, the abstraction of threads is something that
should not be discounted. In my day-to-day work I find
Threads a very useful abstraction within my programs that
cause little problem. They have to be used with restraint
and care - but so does fork().

That is not to say that we cannot do things better. Erlang's
concurrency sounds interesting, Andrae. However, Threads are,
if not the best, then the most common method for supporting
concurrency in imperative programming languages.

I do not disagree with the points of fact made by the
anti-thread camp. However, the Free Unix community seems to
have a lot of people who _really_ hate threads in a way that I
just don't see elsewhere (say in the people I think of as C++
hackers).

My take on this is that what a lot of people are talking about
is how much it sucks to do work with POSIX threads using GNU
tools under Linux; most likely writting in C. And here I agree
entirely. But I think that a large part of this is because the
tools are poor at handling threads, and it is very hard to
write correct threads with pthreads/C because they are just
too low level.

In the Java world, Threads operate at a higher level of
abstaction and are much easier to use correctly. The tool
support for debuggingis also better. I find the abstract
concept of threads in Java very useful. In the C++ world you
can use OO language features to encapsulate threads and data in
a way that makes it much easier to avoid the shared-memory/locking
errors that cause so much woe in C.

Mind you I'd not write a C program that used threads where fork()
would suffice. Then again, for any large programming project I
would not be working in C. Maybe I should learn Erlang. :-)

I guess what I am trying to say to 'non programmers' is that the
'threads are evil' is not the only position in the computing world.
Even if it seems the most common within HUMBUG.

Cheers,

Raymond
-- 
raymond at humbug.org.au



--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list