chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] critical-section not in Chicken 3?


From: Tobia Conforto
Subject: Re: [Chicken-users] critical-section not in Chicken 3?
Date: Sat, 9 Feb 2008 23:27:39 +0100

Elf wrote:
fwiw, threads are not always avoidable
...
it would not be possible to have equivalent functionality without threading, nor would the performance requirements be attainable without threads.

"A computer is a state machine. Threads are for people who can't program state machines." (Alan Cox)

A bold statement, but I kind of agree. Except maybe for when you seek to simulate many random, unpredictable, asynchronous processes, threads are just a quick hack. A hand-crafted, event-based solution is usually more efficient, easier to get right and much easier to debug.

If you lack the needed OS primitives (select, non-blocking I/O, etc.) or if you need to cope with a bad OS, then threads might be the only way to go, but those are cases that call for ugly hacks anyway.

What is it you couldn't do in the raw-sockets egg without threads?


Tobia




reply via email to

[Prev in Thread] Current Thread [Next in Thread]