Max signal per seconds
I would like to know how many signal per second (or any time ratio) a program can catch. The problem is that I want to receive signal them 8 per 8 to fill a char (with sigusr1 for '0' and sigusr2 for '1') And when I don't use sleep-like function the program send "User signal 1 or 2开发者_运维知识库" and then exit.
Is there anyway to determine how many signal a program can catch ? With my test it depends of the sequence duration ( for 100 digits he'll not miss a single one but over 500 he start to miss some of them, I use usleep(1000) between each transmission.
Thanks you.
EDIT: Sorry sending it too soon.
It depends on many variables -- the hardware, the load of the machine due to other software running, etc. There is no way you can tune sleep times to be reliable in all circumstances. External signals are inherently asynchronous.
Basically, you're using signals in a way they weren't intended to be used. For communication of bulk data there are much better IPC choices, from simple pipes to D-Bus with elaborate rendezvous, multicast and filtering capabilities layered on top of sockets.
精彩评论