Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming.threads > #397
| From | James Kuyper <jameskuyper@verizon.net> |
|---|---|
| Newsgroups | comp.std.c, comp.lang.c, comp.programming.threads, comp.unix.programmer |
| Subject | Re: The threading specs in the standard: a new catastrophe |
| Date | 2011-07-07 22:41 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <iv5qpq$ghg$1@dont-email.me> (permalink) |
| References | <iv422a$33k$1@speranza.aioe.org> <iv576t$2lm$1@dont-email.me> <iv58m6$5vo$1@speranza.aioe.org> <4e53ba11-fea9-4896-8bb9-6b45acb6e18f@y24g2000yqb.googlegroups.com> <d8d63934-ea1d-4135-a5f2-1fd7b834042a@v12g2000vby.googlegroups.com> |
Cross-posted to 4 groups.
On 07/07/2011 07:12 PM, sfuerst wrote: > On Jul 7, 3:25�pm, jameskuyper <jameskuy...@gmail.com> wrote: >> jacob navia wrote: ... >>> It would be better that the C standard would scrap all this and add >>> a line: >> >>> "The threads specifications follows the POSIX standard." ... >> It's extremely unlikely to be that simple; the details of what it >> means to follow only a part of the POSIX standard need to be >> specified. I don't know anything specific about that part of the POSIX >> standard, but I would guess that there's a good chance that it cross- >> references other parts of the POSIX standard, either explicitly or >> implicitly. If so, for each such cross-reference, the C committee >> would have to decide whether to add that other section, too, or to add >> words indicating how the meaning of that cross-reference should be >> modified in the context of the new C standard. But let's assume all >> such issues can be dealt with. ... >> Now, William Ahern cross-posted a message to every group that this >> message is posted to, except comp.std.c, in the thread with the >> subject "POSIX threads hard to implement in Windows". In it, he >> indicated that one of the biggest ways in which the Windows version of >> pthreads differs from true POSIX pthreads is that Windows mutexes >> cannot be statically initialized. Therefore, implementers of next >> version of C on a Windows platform face a challenge: how to make >> statically initialized mutexes work as they are required to by POSIX >> (and therefore, also by the new version of C), even though they are >> not permitted by the Windows version of pthreads. >> I'm not very knowledgeable about this area myself, so it's entirely >> possible that I've garbled William Ahern's meaning. Any corrections >> that might be needed in order for that paragraph to make sense would >> be greatly appreciated. >> >> Since you yourself are a C implementer for Windows platforms, would >> you care to describe an implementation strategy for dealing with this >> challenge? > > The simplest mapping of the posix mutex type to windows is the > CRITICAL_SECTION data type. The only difference between the two is > that a posix mutex may have attributes that allow it to be used to > synchronize between processes via a shared memory segment. That's a prime example of the cross-referencing problem I was referring to: the committee would have to decide either to add a specification for processes and shared memory, or to add wording beyond what jacob gives above, modifying whatever it is that the POSIX standard says about such things within the part that describes pthreads. -- James Kuyper
Back to comp.programming.threads | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: The threading specs in the standard: a new catastrophe jameskuyper <jameskuyper@gmail.com> - 2011-07-07 15:25 -0700
Re: The threading specs in the standard: a new catastrophe sfuerst <svfuerst@gmail.com> - 2011-07-07 16:12 -0700
Re: The threading specs in the standard: a new catastrophe James Kuyper <jameskuyper@verizon.net> - 2011-07-07 22:41 -0400
Re: The threading specs in the standard: a new catastrophe "Chris M. Thomasson" <cristom@charter.net> - 2011-07-08 12:47 -0700
Re: The threading specs in the standard: a new catastrophe sfuerst <svfuerst@gmail.com> - 2011-07-08 13:11 -0700
Re: The threading specs in the standard: a new catastrophe "Chris M. Thomasson" <cristom@charter.net> - 2011-07-08 16:56 -0700
Re: The threading specs in the standard: a new catastrophe Marcin Grzegorczyk <mgrzegor@poczta.onet.pl> - 2011-07-09 23:55 +0200
Re: The threading specs in the standard: a new catastrophe sfuerst <svfuerst@gmail.com> - 2011-07-09 18:40 -0700
Re: The threading specs in the standard: a new catastrophe jacob navia <jacob@spamsink.net> - 2011-07-08 01:16 +0200
some sane words, for sure "Greg A. Woods" <woods@robohack.org> - 2011-07-07 18:33 -0700
Re: The threading specs in the standard: a new catastrophe jameskuyper <jameskuyper@gmail.com> - 2011-07-08 08:34 -0700
Re: The threading specs in the standard: a new catastrophe sfuerst <svfuerst@gmail.com> - 2011-07-08 10:47 -0700
Re: The threading specs in the standard: a new catastrophe James Kuyper <jameskuyper@verizon.net> - 2011-07-09 06:57 -0400
Re: The threading specs in the standard: a new catastrophe Alexander Terekhov <terekhov@web.de> - 2011-07-09 13:59 +0200
Re: The threading specs in the standard: a new catastrophe jacob navia <jacob@spamsink.net> - 2011-07-09 14:45 +0200
Re: The threading specs in the standard: a new catastrophe "Chris M. Thomasson" <cristom@charter.net> - 2011-07-10 15:47 -0700
Re: The threading specs in the standard: a new catastrophe Alexander Terekhov <terekhov@web.de> - 2011-07-11 13:38 +0200
Re: The threading specs in the standard: a new catastrophe Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-07-11 16:12 +0300
csiph-web