Search code examples
linuxepollsigqueue

Can signals be pushed from and to self process and then handled as event on EPOLL?


I have to design a real time system which process data received from multiple process on posix mqueue (Proprietary Implementation). The primary requirement is to not change the overall system main loop delay but to handle things on events. I do not want to create events from source process from where i receive the data but rather create signal from the self process to self process triggering the data is received and the data will be handled at EPOLL.

  • So, is it safe to do such a thing ?
  • i tried with a pseudo code and got this as a result : "sigqueue: (errno: 11) Resource temporarily unavailable" what could be the issue for this ?

Thanks in advance.

Regards, Tanuj Sinha


Solution

  • Yes, you can do this. An easy way would be to create a pipe (https://linux.die.net/man/2/pipe). You can read from it in your main loop and write to it from elsewhere.