简体   繁体   中英

Why does my computer keep pausing when I run a progam using the USB-serial ports?

I've written a program that uses three serial ports (two serial ports are on one USB -> serial connector, the other serial port is on its own USB -> serial connector). When I'm running the program, every 5 seconds or so, my computer stops responding, as if the kernel is busy doing something. I'm not writing any files, so it's not flushing to disk, and I'm not running out of memory, so it's not swapping. What else could it be? could it be flushing the serial port or something? That would be weird, because I wait for a response from the serial ports before I write the next bit of data to them.

It happens less if I don't use the last serial port (the one on it's own USB port).

More info:

  • debian lenny (also tried squeeze)
  • linux 2.6.26-2-686 (also tried 2.6.32-5-686)
  • not using ftdi_sio, using libftd2xx1.0.2 (also tried 1.0.4)

libftd2xx seems to be the problem. It changes its thread's priority and seems to busy wait or something that seems to take over the system. Giving user's access to the usb devices in /proc/bus/usb and running the program as a normal user seems to work fine, so I'm not sure why libftd2xx is changing thread priorities.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM