Re: AMIGA will use Linux, but Linux has several

Steve Underwood (steveu@netpage.com.hk)
Wed, 14 Jul 1999 02:42:24 +0000


Hi,

Mike Harrelson wrote:

> > Eh? If you use select or poll directly your code can get a bit messy.
> > However, if you build an event oriented library on top of select you can
> > cook up simple elegant servers very quickly. I've been doing it for years.
>
> And what if you have to interact with something through a library, such as a
> database API? You can't use select/poll, nonblocking/async IO in those cases
> since you don't have direct access to the underlying IO mechanisms.

Yeah, ain't it a stinker. People complain about klunky features like select, but the
really klunky problem you face is trying to fit into someone else's view of the world
(i.e. API). However, I'm not sure your example is a very good one. When trying to
link to a black box API the obvious thing to do is give it its own thread. However,
can you be sure it is thread safe? I hit this problem several times with NT.

>> Threads mean lots of asynchronous behaviour. Asynchronous behaviour means
>> major testing problems. The asynchronous behaviour in select based servers
>> is much more limited, so their testability is much better. I can cook up
>> simple servers based on my event library in a few hours, and they run
>> reliably. A threaded application couldn't be tested well in that time.

> Depends on the design. I can see how threaded applications can be difficult
> to test and debug, especially with a dirth of good thread aware debuggers.
> Most things have their drawbacks I suppose.

Its more than just a need for debuggers. Asynchronous behaviour means tests don't do
the same thing twice. You are forced to try little everything as a heavy running load
test, rather than run one pass of test data. Most of the nasties which occur in
safety critical systems are due to asynchronous activities. Most of the remainder are
due to not testing boundary conditions thoroughly (e.g. checking tangent functions
near 90 degrees in flight control systems). One of the key design review goals on
this type of project is to reduce the number of asynchronous relationships to
increase testability.

Steve

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/