简体   繁体   English

使用USB串行端口运行程序时,为什么我的计算机仍然暂停?

[英]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). 我编写了一个使用三个串行端口的程序(两个串行端口位于一个USB->串行连接器上,另一个串行端口位于其自己的USB->串行连接器上)。 When I'm running the program, every 5 seconds or so, my computer stops responding, as if the kernel is busy doing something. 当我运行程序时,每隔5秒钟左右,我的计算机就会停止响应,就好像内核正忙于做某事。 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). 如果我不使用最后一个串行端口(它自己的USB端口),则发生的情况会更少。

More info: 更多信息:

  • debian lenny (also tried squeeze) Debian Lenny(也尝试过挤压)
  • linux 2.6.26-2-686 (also tried 2.6.32-5-686) linux 2.6.26-2-686(也尝试过2.6.32-5-686)
  • not using ftdi_sio, using libftd2xx1.0.2 (also tried 1.0.4) 不使用ftdi_sio,使用libftd2xx1.0.2(也尝试过1.0.4)

libftd2xx seems to be the problem. libftd2xx似乎是问题所在。 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. 允许用户访问/ proc / bus / usb中的usb设备并以普通用户身份运行程序似乎正常,因此我不确定libftd2xx为什么更改线程优先级。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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