On Tue, Mar 18, 2008 at 8:36 AM, Martin Grimme <[EMAIL PROTECTED]> wrote:
>  Just be careful with threads, because they're evil (TM) !  ;)
>  They are hard to debug, annoy users when deadlocking, and when done
>  wrongly, can have impact on performance.
>
>  My policy is to only use threads when absolutely necessary. In most
>  cases, nonblocking IO and timeout callbacks are fully sufficient, and
>  give more predictable and debuggable behavior. X and most UI-toolkits
>  aren't thread-safe anyway, so threading should never be used in GUI
>  parts.
>
>  Somebody (Richard Stallmann, IIRC) said, "threads are for people who
>  did not understand state-machines". He could be right on this part.

Well, there are a lot of different thread models. Personally I favor
the CSP[1] model to the SRC model (which pthreads follows) see [2] for
reasons. But as mentioned before, for serial communication I'd really
consider to stick with a select()-driven approach.

[1] http://en.wikipedia.org/wiki/Communicating_sequential_processes
[2] http://swtch.com/~rsc/thread/

Kind regards,
--Anselm
_______________________________________________
maemo-developers mailing list
[email protected]
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to