From: "Sreevathsa" <sreevathsa@gmail.com>
To: 'Glynn Clements' <glynn@gclements.plus.com>
Cc: linux-c-programming@vger.kernel.org
Subject: RE: Custom defined object in a signal handler
Date: Wed, 28 Mar 2007 17:22:10 -0700 [thread overview]
Message-ID: <460b06e1.2894bac9.6e94.23cd@mx.google.com> (raw)
In-Reply-To: <17931.925.199685.326663@cerise.gclements.plus.com>
I am working on a multithreaded application in which, in one of the code
paths, multiple threads need to setup a SIGALRM signal (to achieve TCP
retrasmission kind of functionality). When each thread does this, it also
need to pass the address of the structure that it operated upon, so that
when the signal is delivered, the signal handling thread will know the
address of the strucutre and can act upon it.
Is there any way to accomplish this goal? If you need any other info about
the problem environment, I can provide them, please let me know.
Thanks,
Sreevathsa
> -----Original Message-----
> From: linux-c-programming-owner@vger.kernel.org
> [mailto:linux-c-programming-owner@vger.kernel.org] On Behalf
> Of Glynn Clements
> Sent: Wednesday, March 28, 2007 5:09 PM
> To: Sreevathsa
> Cc: linux-c-programming@vger.kernel.org
> Subject: Re: Custom defined object in a signal handler
>
>
> Sreevathsa wrote:
>
> > I have a question regarding signals. Is there a way you can
> pass some
> > custom defined parameter (say, a struct foo * ) to a signal
> handler??
>
> No (other than by using a global variable).
>
> As you can only install a single handler for any given
> signal, there isn't any real need to support closures.
>
> --
> Glynn Clements <glynn@gclements.plus.com>
> -
> To unsubscribe from this list: send the line "unsubscribe
> linux-c-programming" in the body of a message to
> majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2007-03-29 0:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-28 23:54 Custom defined object in a signal handler Sreevathsa
2007-03-29 0:09 ` Glynn Clements
2007-03-29 0:22 ` Sreevathsa [this message]
2007-03-29 3:21 ` Glynn Clements
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=460b06e1.2894bac9.6e94.23cd@mx.google.com \
--to=sreevathsa@gmail.com \
--cc=glynn@gclements.plus.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).