Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.CARNet.hr!news.optima.hr!.POSTED!not-for-mail From: Drazen Kacar Newsgroups: comp.programming.threads,comp.unix.programmer Subject: Re: Open issues in the specification for fork()? Date: Mon, 25 Nov 2013 18:46:36 +0000 (UTC) Organization: =?iso-8859-2?Q?=C8ardak?= ni na nebu, ni na zemlji Lines: 25 Message-ID: References: <5291d497$0$15884$e4fe514c@news2.news.xs4all.nl> <87hab1kdvw.fsf@sable.mobileactivedefense.com> <52929869$0$15987$e4fe514c@news2.news.xs4all.nl> <20131125011903.172db979@laptop.homenet> <52933db8$0$15988$e4fe514c@news2.news.xs4all.nl> NNTP-Posting-Host: 89.201.248.138 X-Trace: l01news1.ot.hr 1385405196 2679 89.201.248.138 (25 Nov 2013 18:46:36 GMT) X-Complaints-To: abuse@optinet.hr NNTP-Posting-Date: Mon, 25 Nov 2013 18:46:36 +0000 (UTC) User-Agent: slrn/pre1.0.0-18 (Linux) X-Face: 'UIE}WabGB0+U>p-#(hp<_+AD2{H],=qR*jHfm$/e]l0(kU3oOYc5lqG6gg>[\h^IOc{' siD6#!T&loIShgmYHz3#+*D38:|`~\BE,(W~Ol9BDfDwk'lKJ;Z{sY8E9(ME.E]'wvNO`$n#,;9Z` tOFcW/nHZq!BOSrM>V?C<5DTw=<${c{M2V+|)0jSUl&!+8%8nI BF(u:E>SZWM^e X-Attribution: Dave Mail-Copies-To: never Cancel-Lock: sha1:HtMk6B3qk9mN9GoFekmS8TlIDX0= Xref: csiph.com comp.programming.threads:2014 comp.unix.programmer:5038 Casper H.S Dik wrote: > If you didn't link with -lthread or -lpthread, you got stubs for many > of the thread calls (such as mutex primitives) so a library could be > written as if it was multi-threaded but would work in a single threaded > application. Not really. Things worked that way and it was generally known that stubs in libc exist[1], but that was neither documented nor supported. So the only entity who could safely write libraries that way was Sun. I don't know if anyone else wrote them that way. I decided not to, because the method was not supported and thus likely to cause trouble if the implementation changes. [1] And, of course, there were people who wrote multi-threaded program, but forgot to add one of the thread libraries to the link line. Then the program would link fine (because of stubs in libc), but none of the thread functions would work. That was a lot of fun for everyone. :-) -- .-. .-. Yes, I am an agent of Satan, but my duties are largely (_ \ / _) ceremonial. | | dave@fly.srk.fer.hr