Hi ..

On Wed, 2005-08-10 at 04:45 +0900, Levin Alexander wrote:
> Hi,
> 
> I am trying to write a some code that expresses a series of  
> Commands/Responses over a serial link.
> 
I think that the "serial link" part is important.  How does the
underlying interface present its data?  Interrupt or polled?  And the
host, does it block on serial data?  

If everything is inherently serial, then there is not much to be gained
with threads.  Are you expecting to do the equivalent of receive a
packet then process it?  If so, then having a polling thread that puts
its processed data in a buffer seems to make sense.  

Coroutines are a funny thing.  They are kind of like multitasking when
there is no other choice (a la FORTH or Modula-2, where I think they
came from).  Ruby threads will buy you more that procedure swapping, I
think.

Just my $0.02

Regards,


-- 
-mark.  (probertm at acm dot org)