Advertisement

07.09.2008 at 06:49AM PDT, ID: 23550166
[x]
Attachment Details

alarm - signal - waitpid alternative

Asked by thimerion in C Programming Language, Signal Processing

Tags: ansi c

Hi,

I had a good working program, what it did was reading a message from a unix queue, forking a process, in the child process execute an ftp script, and in the parent process waiting for the process to end, or waiting for the signal SIGALRM to go off (waitpid is doing that for me).

So this code used to work fine:
signal(SIGALRM, alarm_catcher)
alarm (60)
lreturnpid = waitpid (lpid, &lstatus, 0);

So the waitpid function does exit when, a) the child process terminates b) the SIGALRM is called.

The only change I did was instead of using unix queues, starting to use jms queues to read from (Fiorano).

Appearently Fiorano also reacts on signals, requests SIGALRM signals when no message on the queue and reads SIGALRM signals.

The effect is that my orig code does not work anymore, since Fiorano steals the timeout alarm meant for my script ... I think that is the reason ...

What I am looking for is an alternative for the waitpid function that does not use signals, but does stop waiting after some time or when the process is finished ... what first occurs ...

Thanks,
TimStart Free Trial
 
Loading Advertisement...
 
[+][-]07.09.2008 at 06:57AM PDT, ID: 21963601

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.09.2008 at 07:04AM PDT, ID: 21963684

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: C Programming Language, Signal Processing
Tags: ansi c
Sign Up Now!
Solution Provided By: sunnycoder
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.09.2008 at 09:30AM PDT, ID: 21965534

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.09.2008 at 09:43AM PDT, ID: 21965679

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 01:25AM PDT, ID: 21971385

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 03:48AM PDT, ID: 21971995

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 04:09AM PDT, ID: 21972098

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 06:26AM PDT, ID: 21973081

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 06:37AM PDT, ID: 21973223

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 06:42AM PDT, ID: 21973289

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.10.2008 at 06:59AM PDT, ID: 21973455

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 07:15AM PDT, ID: 21973619

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 07:17AM PDT, ID: 21973636

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 07:37AM PDT, ID: 21973813

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 07:41AM PDT, ID: 21973861

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 07:41AM PDT, ID: 21973862

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628