unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: NIIBE Yutaka <gniibe@m17n.org>
Cc: guile-devel@gnu.org, guile-user@gnu.org
Subject: Re: Threads and asyncs
Date: Wed, 4 Sep 2002 09:28:45 +0900 (JST)	[thread overview]
Message-ID: <200209040028.g840Sjv08056@mule.m17n.org> (raw)
In-Reply-To: <87d6rvaqyc.fsf@zagadka.ping.de>

In threaded applications, we should avoid "asynchronous" signal
handling.  This is some sort of common technique/discipline, I think.

If we do want asynchronous signal handling in threaded applications,
we'll open can of dead-lock worms.  Signal handler will access some
shared data to affect some thread control, which means, need some
mutual exclusion for that.  What if when signal hander will be invoked
asynchronously in the critical region?  Signal handler cannot get the
lock.  That'll be cause of the dead lock(s).

(Usually) In threaded applications, signal is handled synchronously, 
by assigning a dedicated thread for signal handling.  I mean, a thread
like that:
		while (1)
		  {
		    switch (get_signal ()) /* Blocked if none */
		     {
		    case SIGINT:
			sigint_handler ();
			break;
		    case SIGHUP:
			sighup_handler ();
			break;
		    /* ... */
		     }
		  }
-- 


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2002-09-04  0:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87it1oglmq.fsf@zagadka.ping.de>
2002-09-02 21:24 ` Threads and asyncs Tom Lord
     [not found] ` <200209022124.OAA07625@morrowfield.regexps.com>
2002-09-02 21:53   ` Marius Vollmer
2002-09-02 22:24     ` Tom Lord
     [not found]     ` <200209022224.PAA07962@morrowfield.regexps.com>
2002-09-02 23:51       ` Marius Vollmer
2002-09-02 23:02   ` Rob Browning
     [not found]   ` <87k7m43si7.fsf@raven.i.defaultvalue.org>
2002-09-02 23:24     ` Tom Lord
     [not found]     ` <200209022324.QAA08246@morrowfield.regexps.com>
2002-09-02 23:36       ` Tom Lord
     [not found]       ` <200209022336.QAA08304@morrowfield.regexps.com>
2002-09-02 23:52         ` Lynn Winebarger
     [not found]         ` <0209021852361X.19624@locke.free-expression.org>
2002-09-03  0:57           ` Tom Lord
     [not found]           ` <200209030057.RAA08617@morrowfield.regexps.com>
2002-09-03  1:13             ` Thomas Bushnell, BSG
     [not found]             ` <87admzub73.fsf@becket.becket.net>
2002-09-03  1:29               ` Tom Lord
2002-09-03  1:31               ` Tom Lord
2002-09-03  1:00         ` Thomas Bushnell, BSG
     [not found] ` <87ptvvubst.fsf@becket.becket.net>
     [not found]   ` <200209030128.SAA08719@morrowfield.regexps.com>
2002-09-03  1:23     ` RnRS process/history/documentation (was Re: Threads and asyncs) Lynn Winebarger
2002-09-03  1:27     ` Threads and asyncs Rob Browning
2002-09-03  1:34     ` Thomas Bushnell, BSG
     [not found]     ` <87u1l73ls1.fsf@raven.i.defaultvalue.org>
2002-09-03  1:45       ` Tom Lord
2002-09-03  1:48       ` Lynn Winebarger
2002-09-03  1:28   ` Tom Lord
2002-09-03 18:06 ` Marius Vollmer
2002-09-04  0:28   ` NIIBE Yutaka [this message]
2002-09-04 18:02     ` Marius Vollmer
2002-09-04 22:30       ` NIIBE Yutaka
2002-09-02 20:52 Marius Vollmer

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

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200209040028.g840Sjv08056@mule.m17n.org \
    --to=gniibe@m17n.org \
    --cc=guile-devel@gnu.org \
    --cc=guile-user@gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).