🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #3328

Re: Throwing an exception from within a signal handler

#3328
From: Dick Menninger
Date: Thu, 08 Feb 1996 22:45
30 lines
2175 bytes
> ==========Tom Payne, 2/4/96==========

[...]
 
> Atomicity of such updates to atomic variables is not always a problem.
> For instance, in most cases a signal handler can increment an atomic
> counter (e.g. a timer) without difficulties, even though the
> read/modify/write sequence is not atomic.  In the case of nonatomic
> variables, atomicity must be enforced by blocking certain signals.
> Such blockage could be portably implemented via atomic blockage flags,
> which, in turn, are volatile atomic variables that must be read by
> signal handers.

Although that could keep them from reading a bad value,
they have no way to wait for it to become valid if they
interrupted the owner. So, the updater thread would have
to fully block the signals that really need the value in the
handler for handling to proceed.  That is, the problems
are more severe than between threads that do not interrupt
each other (a signal handler is just a specialized thread,
whether or not the environment's terminology calls it that
is irrelevant).

Good Day
Dick
Dick.Menninger@DaytonOH.ATTGIS.COM
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
Technical Details
Message-ID: <DMH620.FKn@falcon.daytonoh.attgis.com>
Path: arc1-ca.pugleaf.net!fido.asd.sgi.com!austern
References: <4f2th6$4qh@galaxy.ucr.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!fido.asd.sgi.com!austern
From: Dick Menninger <Dick.Menninger@daytonoh.attgis.com>
Newsgroups: comp.std.c++
Subject: Re: Throwing an exception from within a signal handler
Date: 08 Feb 1996 14:45:40 PST
Organization: AT&T Global Information Solutions
Approved: austern@isolde.mti.sgi.com
Message-ID: <DMH620.FKn@falcon.daytonoh.attgis.com>
References: <4f2th6$4qh@galaxy.ucr.edu>
Reply-To: mennid <Dick.Menninger@daytonoh.attgis.com>
NNTP-Posting-Host: isolde.mti.sgi.com
X-Original-Date: Thu, 8 Feb 1996 20:54:00 GMT
X-Newsreader: DiscussIT 2.5.1.3 for MS Windows [AT&T Software Products Division]
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBVAwUBMRp9L0y4NqrwXLNJAQFB6AIAzpVWtlf6ovMqVeRvoHb8igZXDpDTCTDd
 5PFz9B7ZubFubEdUtAD2T27RDwD9RdQ8BY0LiShBt60/6NtH1GGe0Q==
 =yGv+
Originator: austern@isolde.mti.sgi.com