[Gambas-user] High CPU usage when using serialport component

Benoît Minisini gambas at ...1...
Sat Aug 11 16:52:35 CEST 2012


Le 11/08/2012 16:40, Benoît Minisini a écrit :
> Le 11/08/2012 15:58, Christer Johansson a écrit :
>>
>>
>>> -----Original Message-----
>>> From: Benoît Minisini [mailto:gambas at ...1...]
>>>
>>> 2) By commenting all SPort1_xxxChange event handlers in the example
>>> source code?
>>
>> Bingo! This improved things alot...
>>
>> Running a quick test CPU usage was 0.0% after opening /dev/ttyAMA0 as
>> expected.
>> Will do some more testing with USB to TTL adapter when I get back...
>>
>> /CJ
>>
>
> So maybe I was right. I will try to do the polling differently, and will
> add a property to define the frequency of the polling.
>
> Regards,
>

Can you try the unmodified SerialPort example with revision #5029?

Now I do the polling with a fixed frequency. That frequency is defined 
with a new optional argument to the Open() method. It is 50ms by 
default, so the CPU usage should be lower.

Regards,

-- 
Benoît Minisini




More information about the User mailing list