> > > > Benoit, > > > > runned valgrind tool for a while. > > > > And I got a rather strange winner, I got 3 milion calls of _add_char in > > gb_error.c > > > > Some debug code hanging around or something like that? > > > > See attached valgrind file. > > > > Regards, > > Ron_2nd. > > The reason is a lot of one-byte reading that raises the EOF error. This > should be logical if the read event handler is called whereas there is > nothing to read, and then you read one byte. > > But why Linux tells me (the interpreter actually) that there is something > to read on the serial port file descriptor, whereas there is nothing? > > Regards, >
Hmm. I tested the SerialPort example by sending data to it, and I don't see any CPU consumption. What happens if you don't read the data byte by byte, but all the available data at once, as the SerialPort example does? This way: PUBLIC SUB MySerialPort_Read() DIM s AS String READ #MySerialPort, s, Lof(MySerialPort) ... END -- Benoît Minisini ------------------------------------------------------------------------------ Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user