ts-7000
[Top] [All Lists]

Re: [ts-7000] Block problem when reading from a serial port.

To:
Subject: Re: [ts-7000] Block problem when reading from a serial port.
From: David Hawkins <>
Date: Mon, 29 Sep 2008 11:34:17 -0700
Hi Rodrigo,

> I don't think we are using any extra port on TS but the regular ones
> includes in the basic board.

Ok, I would imagine that those ports should use standard
serial drivers. However, your best-bet is to confirm
that using your x86 desktop or laptop.

> One of our developer report that the close(fd) on that serial
> port file descriptor does not unblock the read().
> I will double check but I'm pretty sure they try that.

Thats entirely possible.

> The use of the select function seems to be a partial solution that could
> work for us but I was wondering why this fails.
> 
> I wrote before a layer that works for other platforms like Win32 and then I
> use another function to unblock the thread.
> Then we migrate the layer to Linux only to found that stopping the thread is
> really complicated.
> 
> Somebody in this group reply about sending a signal using pthread_kill?
> 
> Will this unblock the 'read' statement for the target thread?
> I assume read will return an amount read of -1 or 0.
> If that is the case we could immediately detect that the driver needs to be
> closed and gracefully exit the thread.

Again, I would think it should, but writing code is the
ultimate confirmation.

If you have to deal with lots of threads, then adding signals
can make things complicated. Using multiple file descriptors
with select() will generally result in safer code.

Cheers,
Dave


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU