Subj : Re: Optimizing for latency To : comp.programming.threads From : scream29125 Date : Wed Jun 08 2005 06:58 am > How does the process wait for an interrupt? I don't know. This is part of a low-level API provided to me. I call a function, similar to: receive(device_ID, request_buffer, buffer_size, BLOCK); This function will block until the device responds with some request. It used to sit in a loop, which consumed 100% CPU time. This has been changed to use interrupts instead. Is there a "good" and "bad" way to wait for an interrupt? > What are the threads doing when they're not actively > servicing a device? They are blocked waiting for a request, as shown above. I have done tests with jobs that require minimal CPU interaction, and other jobs that require lots of CPU interaction. Those jobs requiring more CPU interaction tend to perform worse than those require little interaction. In all cases, "top" and "ps" report plenty of idle CPU cycles. This is why I guessed that the problem is due to multiple devices requiring attention simultaneously. I'm open to the possibility that I'm wrong with this guess... if you have any suggestions on how I can dig deeper into this. .