Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.unix.programmer > #931

Re: POSIX threads hard to implement in Windows

From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c, comp.programming.threads, comp.unix.programmer
Subject Re: POSIX threads hard to implement in Windows
Date 2011-07-11 06:20 -0400
Organization A noiseless patient Spider
Message-ID <iveiov$9b4$1@dont-email.me> (permalink)
References (13 earlier) <iv42dd$ed2$2@dont-email.me> <iv4blu$79l$1@dont-email.me> <c1ahe8-hi.ln1@wilbur.25thandClement.com> <aedpe8-ca1.ln1@jones.homeip.net> <j2ope8-04h.ln1@wilbur.25thandClement.com>

Cross-posted to 3 groups.

Show all headers | View raw


On 07/10/2011 07:09 PM, William Ahern wrote:
> In comp.unix.programmer lawrence.jones@siemens.com wrote:
>> William Ahern <william@wilbur.25thandclement.com> wrote:
>>>
>>> POSIX threads can be implemented quite comprehensively on Windows:
>>>
>>>         http://sourceware.org/pthreads-win32/conformance.html
> 
>> Then why is there a long list of unimplemented functions?  Certainly
>> there are *parts* of pthreads that can be implemented on Windows, but
>> that's not the same thing as implementing the whole thing.
> 
> The list isn't that long. What distinguishes those interfaces is that they
> can't be implemented on top of, e.g., the stdio implementation. The original
> question, as I understood it, was whether the general architecture of
> Windows was a reasonable fit for a POSIX threads implementation. Most of the
> library can be implemented without unwarranted chumminess with the
> underlying implementation, and the remaining pieces--with signals being the
> biggest question mark--would appear to require only minimal cooperation by
> the vendor.
> 
> Not that I believe C1x should adopt pthreads, mind you. Also, the proposal
> was qualified--it suggested adopting a _subset_ of pthreads.

There are two proposals that I'm aware of, neither of which can be
accurately described as a "subset of pthreads". The official proposal is
for changes to the language and a set of new library functions that
could be implemented as thin wrappers for pthreads functions, but are
sufficiently generic in their definitions that they could alternatively
be implemented as thin wrappers for other threading systems.

The second proposal has not been officially made, but has been suggested
in a number of forms in this forum. That proposal is that the entire
pthreads specification from POSIX should be inserted, by reference, into
the C standard. While not explicitly stated, the implications have been
that it would need little or no additional wording would be needed,
beyond the statement that it has been so incorporated.

The list of pthreads features which have not been implemented in Windows
is an argument in favor of the official proposal, over the unofficial
one. In the unlikely event that the second proposal were accepted, a
conforming implementation of C running under Windows would be required
to implement all of the items on that list. How difficult would that be?
If Microsoft has not even attempted to implement them, I imagine it
would be pretty difficult.

The fact that even those features which are available, are available
only in the POSIX Subsystem of Windows, and not for native Windows
programs, is another such argument. If I understand it correctly, the
official proposal defines a system that could be made available even for
native Windows programs.
-- 
James Kuyper

Back to comp.unix.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

POSIX threads hard to implement in Windows (was: C is fixed or not ?) Noob <root@127.0.0.1> - 2011-07-07 15:17 +0200
  Re: POSIX threads hard to implement in Windows William Ahern <william@wilbur.25thandClement.com> - 2011-07-07 11:21 -0700
    Re: POSIX threads hard to implement in Windows Ian Collins <ian-news@hotmail.com> - 2011-07-08 08:07 +1200
      Re: POSIX threads hard to implement in Windows Robert Wessel <robertwessel2@yahoo.com> - 2011-07-07 16:01 -0500
        Re: POSIX threads hard to implement in Windows "MikeP" <mp011011@some.org> - 2011-07-07 21:12 -0500
          Re: POSIX threads hard to implement in Windows Robert Wessel <robertwessel2@yahoo.com> - 2011-07-07 23:33 -0500
            Re: POSIX threads hard to implement in Windows "MikeP" <mp011011@some.org> - 2011-07-07 23:49 -0500
          Re: POSIX threads hard to implement in Windows BGB <cr88192@hotmail.com> - 2011-08-03 07:32 -0700
      Re: POSIX threads hard to implement in Windows William Ahern <william@wilbur.25thandClement.com> - 2011-07-07 15:06 -0700
    Re: POSIX threads hard to implement in Windows lawrence.jones@siemens.com - 2011-07-10 16:08 -0400
      Re: POSIX threads hard to implement in Windows William Ahern <william@wilbur.25thandClement.com> - 2011-07-10 16:09 -0700
        Re: POSIX threads hard to implement in Windows James Kuyper <jameskuyper@verizon.net> - 2011-07-11 06:20 -0400
          Re: POSIX threads hard to implement in Windows Ian Collins <ian-news@hotmail.com> - 2011-07-11 22:36 +1200
      Re: POSIX threads hard to implement in Windows scott@slp53.sl.home (Scott Lurndal) - 2011-07-11 16:18 +0000
        Re: POSIX threads hard to implement in Windows Geoff Clare <geoff@clare.See-My-Signature.invalid> - 2011-07-12 13:30 +0100
  Re: POSIX threads hard to implement in Windows (was: C is fixed or not ?) Joshua Maurice <joshuamaurice@gmail.com> - 2011-07-07 19:01 -0700
  Re: POSIX threads hard to implement in Windows (was: C is fixed or not ?) "Ersek, Laszlo" <lacos@caesar.elte.hu> - 2011-07-14 23:05 +0200

csiph-web