Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Using Select attach like readcond: (2 Items)
   
Using Select attach like readcond  
Hello,

I have a thread that uses readcond() to wait for data on a serial port.
I am using readcond() because I want to wait for a minimum amount of data before running to prevent lots of context 
switching when data is coming in quickly.

Since I already have a Dispatch pool in my application, I would like to replace this thread with a 'service' using 
select attach.  I have it working, but the attached handler runs the minute data starts to come in on the port.  I get a
 lot of 1 - 3 byte buffers running through the system.

How can I mimic the behavior of readcond with a select attach handler?

Thanks,
- Mike
Re: Using Select attach like readcond  
> Hello,
> 
Check out http://www.unixwiz.net/techtips/termios-vmin-vtime.html

Not sure if QNX supports it though.

> I have a thread that uses readcond() to wait for data on a serial port.
> I am using readcond() because I want to wait for a minimum amount of data 
> before running to prevent lots of context switching when data is coming in 
> quickly.
> 
> Since I already have a Dispatch pool in my application, I would like to 
> replace this thread with a 'service' using select attach.  I have it working, 
> but the attached handler runs the minute data starts to come in on the port.  
> I get a lot of 1 - 3 byte buffers running through the system.
> 
> How can I mimic the behavior of readcond with a select attach handler?
> 
> Thanks,
> - Mike