Deutsch   English   Français   Italiano  
<vljiml$296n5$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Muttley@DastardlyHQ.org
Newsgroups: comp.unix.programmer
Subject: Re: OT: Windows (Was: Re: Open Source does not mean easily
Date: Tue, 7 Jan 2025 15:53:57 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <vljiml$296n5$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <vljcbk$27v6l$1@dont-email.me> <vljcse$sis$2@reader2.panix.com> <vljgbg$28o6f$1@dont-email.me> <vljhkg$gvf$1@reader2.panix.com>
Injection-Date: Tue, 07 Jan 2025 16:53:57 +0100 (CET)
Injection-Info: dont-email.me; posting-host="8c5e3bb50f8ae50dc4390f343511cdc4";
	logging-data="2398949"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19YUOSrzn4Am3BGVgABAVoD"
Cancel-Lock: sha1:ACzzqPXmnWMgcD7pAtX9p7ZA7ZA=
Bytes: 3368

On Tue, 7 Jan 2025 15:35:44 -0000 (UTC)
cross@spitfire.i.gajendra.net (Dan Cross) wibbled:
>In article <vljgbg$28o6f$1@dont-email.me>,  <Muttley@DastardlyHQ.org> wrote:
>>On Tue, 7 Jan 2025 14:14:38 -0000 (UTC)
>>cross@spitfire.i.gajendra.net (Dan Cross) wibbled:
>>>In article <vljcbk$27v6l$1@dont-email.me>,  <Muttley@DastardlyHQ.org> wrote:
>>>>On Tue, 7 Jan 2025 13:18:54 -0000 (UTC)
>>>>cross@spitfire.i.gajendra.net (Dan Cross) wibbled:
>>>>>In article <vlip2c$24ccb$1@dont-email.me>,  <Muttley@DastardlyHQ.org>
>wrote:
>>>>>>On Mon, 06 Jan 2025 16:46:56 GMT
>>>>>>ITYF it is VERY widely shared and having a signal safe API function is
>only
>>>>>>step 2 - plenty of the functions in the program itself or 3rd party
>library
>>>>>>functions are probably not re-entrant safe and even if they are, having
>>>>>>code stomp over itself - eg if in the middle of writing a log message then
>
>>>a 
>>>>>>signal is generated which tried to write a log message itself - is a very
>>>>>>poor way to write code.
>>>>>
>>>>>So don't write code that way.  It does not follow that the only
>>>>>thing you can do in a signal handler is an some atomic flag
>>>>>somewhere.
>>>>
>>>>Just because you can doesn't mean you should. C lets you do a lot of things
>>>>that are a Bad Idea.
>>>
>>>I have to ask at this point: have you ever written a concurrent
>>>program under Unix?  One that used signals?  For that matter,
>>>have you ever written a program that used `fork()` and caught a
>>>`SIGCHLD`?
>>
>>Is that supposed to be a serious question?
>
>Yes.
>
>>The only thing that should ever be done in a child exit handler is a wait*()
>>or set a flag.
>
>I think perhaps you should try to write some complex programs in
>the Unix environment before making such categorial statement.

Don't be patronising. I've probably written more unix software in 30 years
than you've had hot dinners including a fully featured telnetd and numerous
other servers for work and play. And in the places I've worked which included
finance/banking, aerospace and government, the advice was almost always NOT to 
use signals in the first place unless there was no choice - eg SIGCHLD - but if
you did then do very little in the handler and nothing that could cause any 
re-entrancy issues.

I suspect its you who needs a bit more practice at writing large multi process
and multi threaded applications.