Re: Reduce CPU time while using serialport?
- From: jis <jismagic@xxxxxxxxx>
- Date: Sat, 08 Sep 2007 15:29:52 -0000
On Sep 8, 9:11 am, Brian McCauley <nobul...@xxxxxxxxx> wrote:
On 6 Sep, 21:18, jis <jisma...@xxxxxxxxx> wrote:
I am using Win32::serialport for reading a data through a scanner
which is connected to the serial port.
I use polling as below.But this consumes 99% of my CPU time. and
slows down the system.
while(!($data=~/\r/))
{
$data=$Scanner->input(); #read the scanner port
$labeldata=$labeldata.$data; #append
}
Is there any way I implement interrupts or events using perl. Or is
there any other method to solve this issue.
Is there any particular reason you couldn't simply use a blocking read
rather than a non-blocking one?
I am now trying to use $Scanner->lookfor which is a blocking read i
believe. But main issue now is I am using a perl tk window in the
program. The tk window needs continuous update.The call lookfor takes
me to unknownloop and prevents me from servicing tk window.
Appreciate your help.
Cheers,
jis
.
- Follow-Ups:
- Re: Reduce CPU time while using serialport?
- From: Petr Vileta
- Re: Reduce CPU time while using serialport?
- References:
- Reduce CPU time while using serialport?
- From: jis
- Re: Reduce CPU time while using serialport?
- From: Brian McCauley
- Reduce CPU time while using serialport?
- Prev by Date: Re: Reduce CPU time while using serialport?
- Next by Date: Re: Reduce CPU time while using serialport?
- Previous by thread: Re: Reduce CPU time while using serialport?
- Next by thread: Re: Reduce CPU time while using serialport?
- Index(es):
Relevant Pages
|
|