LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-20-2018, 04:02 AM   #1
amit_huda
LQ Newbie
 
Registered: Aug 2018
Posts: 1

Rep: Reputation: Disabled
Lightbulb Error in timer_create(), How to resolve EAGAIN (errno 11)?


I am using POSIX call for timer that is timer_create(). Application requires large no of timers so i was testing different scenarios for that and i found that after "ULIMIT_SIGPENDING", create_timer() function all returns with error and error no is EAGAIN (errno 11). That means system has max no of signals are pending.

As i want to solve this problem, i went further in problem and i wrote a simple timer application in which there is very less probability of signal pending.

sudo code is as follow,

Code:
void CreateTimerFirstTime()
{
  //create timer and on time out call function TimeOut()
}

void TimeOut
{
  //create timer and on time out call function TimeOut()
  //print timer no
}

with above exercise i came to know that ULIMIT_SIGPENDING is same as no of timers created and TimedOut, although after that create_timers() gives error "Resource temporarily unavailable"

Note : During application i have also checked file descriptor list by command "lsof" and that does not have any large no of file descriptors.

so my question is..

Why system is returning error that maximum signal is pending while every timer has Timedout properly ?
What is solution for this problem without making ULIMIT_SIGPENDING to unlimited ?
Now, if signal is pending in that application is there any way we can see those signal via any command or anything like that ?
Any help will be appreciated. Thank You

Edit 1 :

Further more, as per my third question i was finding way to see pending signal and i found out that there no pending signal.

Note : I am using SIGRTMIN signal.

so the question is why create_timer() giving EAGAIN error?

Every help is appreciated. Thank You

i used below code.

Code:
void GetAndPrintPendingSignal()
{
    sigset_t  waiting_mask;
    int signalcount = 0 ;

    //sigemptyset (&base_mask);
    //sigaddset (&base_mask, SIGINT);
    //sigaddset (&base_mask, SIGTSTP);

    ///* Block user interrupts while doing other processing. */
    //sigprocmask (SIG_SETMASK, &base_mask, NULL);

    /* After a while, check to see whether any signals are pending. */
    sigpending (&waiting_mask);

    printf("Singal Pending No :: %d\n",sigpending(&waiting_mask));
    //  printf("Singal Pending YES/NO :: %d\n",sigismember(&waiting_mask, SIGRTMIN));

    while(1)
    {
        sigemptyset(&waiting_mask);
        sigpending(&waiting_mask);
        if(1 == sigismember(&waiting_mask, SIGRTMIN))
        {
            /* User has tried to kill the process. */
            printf("Singal Pending No :: %d\n",signalcount++);
        }
        else
        {
            break;
        }
    }
}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to resolve EAGAIN (errno 11) from timer_create? codeblazer Linux - Newbie 0 07-03-2012 06:08 PM
Non-atomic Scokect Write and EAGAIN error in RHEL 5.4 amv Linux - General 3 08-30-2010 07:51 AM
Non-atomic Socket Write and EAGAIN error amv Linux - Networking 0 08-26-2010 12:52 AM
Need help in linux to get the error codes (EAGAIN,EOVERFLOW) Meena Programming 1 08-03-2006 08:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration