From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,689ead9f7415a732 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2002-08-28 21:04:49 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!snoopy.risq.qc.ca!newsfeed.news2me.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Newsgroups: comp.unix.tru64 Subject: Re: fork() problem References: From: Paul Pluzhnikov Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 29 Aug 2002 04:04:17 GMT NNTP-Posting-Host: 24.205.78.167 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1030593857 24.205.78.167 (Wed, 28 Aug 2002 21:04:17 PDT) NNTP-Posting-Date: Wed, 28 Aug 2002 21:04:17 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.unix.tru64:8513 Roman Prokhorov writes: > I have a problem: Under Tru64 the fork() called from a thread freezes. > This doesn't happen on the other Unixes I tried. See my code below, did > I do anything wrong? Yes. Your question has been answered many times in comp.programming.threads. Search groups.google.com for "thread fork async" ... Here is one answer by Kaz Kylheku Message-ID: Mind you, according to POSIX, if a threaded process forks a child, that child can execute only async safe functions. It can use exec() to load a new process image. Since fprintf() is not async safe, calling it results in undefined behavior. Cheers, -- In order to understand recursion you must first understand recursion.