Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.std.c,comp.lang.c Subject: Re: The threading specs in the standard: a new catastrophe Date: Fri, 08 Jul 2011 16:24:09 +1200 Lines: 37 Message-ID: <97nf4oF6tbU2@mid.individual.net> References: <97m59uF1nsU1@mid.individual.net> <97mluqFbcvU6@mid.individual.net> <97ndh8F5p5U1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net vukqOHbJWp0HJQgYVkQyCwjsKKJRfCedyG2QB/kpY30nTGkDKd Cancel-Lock: sha1:uoBLLDVCJ4IY1gr7VV2XwdNPTug= User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.9) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.4 In-Reply-To: <97ndh8F5p5U1@mid.individual.net> Xref: x330-a1.tempe.blueboxinc.net comp.std.c:639 comp.lang.c:7934 On 07/ 8/11 03:58 PM, Wojtek Lerch wrote: > On 07/07/2011 5:14 PM, Ian Collins wrote: >> On 07/ 8/11 04:31 AM, Wojtek Lerch wrote: >>> On 07/07/2011 6:33 AM, jacob navia wrote: >>> .... >>>> 2) The proposed functions are absurd. >>>> ... so it is impossible to use. >>> >>> Do you find fopen() absurd and impossible to use too? Or are file or >>> stream attributes (such as the POSIX permission bits, or O_EXCL) less >>> important to you than some of the thread attributes that POSIX or >>> Windows have? >> >> Is really an appropriate analogy? Using fopen or open is an >> implementation detail whereas the choice of thread implementation is a >> pretty fundamental design decision. > > Really? I have written a lot of code using vanilla pthread_create() etc > without setting any attributes to override any defaults of my threads, > mutexes, or condvars; converting that code to the new C API would be > purely a matter of mechanically renaming things. On some other > occassions, I did use some of the POSIX features that are absent int the > C1X draft, and probably in many of those cases converting my code to C1X > would require some non-trivial redesigning. But I can say all the above > about the C99 and POSIX file APIs -- choosing an API that supports > directories, allows accessing unlinked files, and lets you control > permissions can for sure impace the design compared to having to > restrict your code to using the simplistic C99 file API. Yes I agree with the above as I wrote later in my post. In most cases the new API will save passing a NULL for the default action! The pthreads feature I'll miss most is process shared, which is why I said it is important for standard and native threads to be compatible under the hood. -- Ian Collins