LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Set Maximum allowed per-process timer (https://www.linuxquestions.org/questions/programming-9/set-maximum-allowed-per-process-timer-535032/)

george_7117 03-06-2007 06:48 AM

Set Maximum allowed per-process timer
 
Hello!

I am using timer_create() function to create a per-process timer. I was able to create 256 per process timers. However, I wanted to created at least 10,000 per-process timers. In this regard, is there a way to set the limitation for the allowed timers that the process can create?

Sort of like setting the maximum of message queue (msgmni) by setting it in sysctl.conf as kernel.msgmni = xxxx.

Thanks a lot!


P.S. I use another PC to run my code, and I really do not know the reason why, but I was able to create 7654 per-process timers using timer_create function. Is the timer creation have any relation to the memory of the PC? or any hardware components?

Anyway, I do hope you could give some points with regards to setting the allowable per-process timer. Thanks again!

jim mcnamara 03-06-2007 09:12 AM

Basically, each timer ties up resources for asynchronous notification - realtime signals. I believe it is a kernel parameter that determines to number of the timers that can be created. This number is a system-wide value, not per process. I'm not positive.

This is the important part, not the system parm:

What you are doing seems to be really bad application design. Your code will spend all of the cpu time allocated to it processing interrupts, spend very little time doing anything else. With your design, it is likely to have a lot of expiry signals sent that never get processed. What are you trying to do? There must be a more system-friendly approach.

george_7117 03-06-2007 07:25 PM

Set Maximum allowed per-process timer
 
you are right. however, we have thought about a lot of scenarios, and using the OS timer functions/signal interrupts are much less burdensome to the CPU than using or creating a sort of timeout watch thread.

anyway, do you have any idea how to change the kernel parameters to be able to set the maximum allowed timers? or do i need to install a patch or a high resolution timer package?

thanks again.


All times are GMT -5. The time now is 02:44 PM.