From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8893269a4640c798 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-22 18:08:39 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!washdc3-snh1.gtei.net!news.gtei.net!chcgil2-snh1.gtei.net!news.bbnplanet.com!wn12feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!not-for-mail From: Dave Thompson Newsgroups: comp.lang.ada Subject: Re: terminate applications Message-ID: References: X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 23 Jul 2003 01:08:38 GMT NNTP-Posting-Host: 12.89.133.126 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1058922518 12.89.133.126 (Wed, 23 Jul 2003 01:08:38 GMT) NNTP-Posting-Date: Wed, 23 Jul 2003 01:08:38 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:40680 Date: 2003-07-23T01:08:38+00:00 List-Id: On Fri, 18 Jul 2003 11:36:20 +0200 (MET DST), christoph.grein@eurocopter.com wrote: > In C there is no built-in tasking so (AFAIK) exiting a program with a call to > exit(0) is easy (as as easy as in Ada if you have no tasking). > > What you have to do if you are running threads in C, I do not know. Perhaps then > the problem is similar. In POSIX/SUS threads exit() or _Exit() (or abort() or a fatal signal) in any thread, or returning from main(), terminates the process including all threads (without threadaware cleanup). If you pthread_exit() from the main thread, the process continues until all threads exit (pthread_exit() or return from the thread function). You can explicitly coordinate such a multi-thread shutdown, typically (most easily) by having the main thread pthread_join() all the 'children' (in quotes because no hierarchy is enforced). - David.Thompson1 at worldnet.att.net