Signals, shared memory or something else in daemon?

B

BigCalm

I'm currently modifying a daemon (on AIX unix) which is primarily C
source. At the moment, the daemon sleeps 30 seconds before checking
if it has anything to do, but I'd like to improve this so that
something else can trigger it to wake up immediately.

I can handle the wake-up code, it's the signalling that's giving me
headaches - I'm not sure what the best way of doing it?

Should I trap a certain signal sent to the process, (say SIGUSR1)?
Only problem with this is that I can't signal from anyone else except
the owner of the daemon or root. Can I set the process so that it can
be signalled by anyone?

Should I use shared memory and check it every second or so?

Or some kind of interrupt?

Thanks

- Jon
 
J

Jens.Toerring

BigCalm said:
I'm currently modifying a daemon (on AIX unix) which is primarily C
source. At the moment, the daemon sleeps 30 seconds before checking
if it has anything to do, but I'd like to improve this so that
something else can trigger it to wake up immediately.
I can handle the wake-up code, it's the signalling that's giving me
headaches - I'm not sure what the best way of doing it?
Should I trap a certain signal sent to the process, (say SIGUSR1)?
Only problem with this is that I can't signal from anyone else except
the owner of the daemon or root. Can I set the process so that it can
be signalled by anyone?
Should I use shared memory and check it every second or so?
Or some kind of interrupt?

Sorry, but I guess you didn't up in the right newsgroup for these
kinds of questions, since, even though your program seems to be
written in C, they are rather system (UNIX) specific and thus
off-topic here. So I would strongly recommend that you send it
instead to e.g. comp.unix.programmer where people will be very
willing to help you.
Regards, Jens
 
A

Alan Balmer

I'm currently modifying a daemon (on AIX unix) which is primarily C
source. At the moment, the daemon sleeps 30 seconds before checking
if it has anything to do, but I'd like to improve this so that
something else can trigger it to wake up immediately.

I can handle the wake-up code, it's the signalling that's giving me
headaches - I'm not sure what the best way of doing it?

Should I trap a certain signal sent to the process, (say SIGUSR1)?
Only problem with this is that I can't signal from anyone else except
the owner of the daemon or root. Can I set the process so that it can
be signalled by anyone?

Should I use shared memory and check it every second or so?

Or some kind of interrupt?
You probably want to post this to comp.unix.programmer. When you do,
it would be good to give them a clue as to what the "something else"
is that should trigger the response. What does "checking if it has
anything to do" mean?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top