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


Groups > comp.lang.c > #91061

Re: [C/POSIX] pthread_exit()

From Randy Howard <rhoward.mx@EverybodyUsesIt.com>
Newsgroups comp.lang.c
Subject Re: [C/POSIX] pthread_exit()
Date 2016-07-25 16:36 -0500
Organization Aioe.org NNTP Server
Message-ID <nn60o4$me$1@gioia.aioe.org> (permalink)
References (6 earlier) <nn28nf$d6g$1@dont-email.me> <nn5seo$1pg0$1@gioia.aioe.org> <62f39bef-78f8-6715-6606-7be7d54feb45@verizon.net> <nn5u5i$1rs5$1@gioia.aioe.org> <0771146f-c572-1889-6a06-06d62a955f13@verizon.net>

Show all headers | View raw


On 7/25/16 3:59 PM, James R. Kuyper wrote:
> On 07/25/2016 04:52 PM, Randy Howard wrote:
>> On 7/25/16 3:32 PM, James R. Kuyper wrote:
>>> On 07/25/2016 04:22 PM, Randy Howard wrote:
>>> ....
>>>> Indeed.  Meanwhile, pthread support is available on Windows,
>>>
>>> I asked you a question about POSIX and Windows on 2016-07-23, which you
>>> never answered. The above comment reinforces my suspicion that you
>>> should be able to answer it. Can you?
>>
>>
>> I've somehow missed it, apparently.
>
> I can repeat it:
>
> The last time I heard expert opinion on the matter, I was told that
> there is a POSIX subsystem for Windows, which implements many (but not
> all) of the features required to conform fully to POSIX, and that use of
> this sub-system is incompatible with full use of all Win32 features.
> Other people claimed that those experts were talking nonsense, with the
> implication that there is an implementation of pthreads that both fully
> conforms to POSIX and is fully compatible with all features of Win32 -
> except, they never actually said so, they just implied it, and never
> answered detailed questions about those implications.

There is some support for a lot of POSIX functions under Windows, even
if you do not include pthreads under that umbrella. Some of them behave
exactly like you would expect elsewhere, others are 'sort of' like what
you would expect, so in that sense, NOT fully compatible. This is in
the context of things supported by Microsoft themselves on the platform.

Pthreads support that I made use of was done externally, originally
called pthreads-win32, although that was later made to work on win64 as
well and possibly renamed? In general, the bolt-on at the time was 
pretty straightforward.

I haven't used recent versions of the windows pthreads support, as I no
longer can be bribed with enough money to make me work on Windows ever
again.

However, when I was using it, modulo a few bugs that were resolved, I
didn't have any serious difficulty porting pthreads code that ran on
half a dozen other platforms to Windows. The pthreads for windows
project has (or at least had) a fairly active mailing list that helped
get things sorted out pretty quickly.

Getting other things to work portably was more difficult, although I
did learn a fair bit about hiding Windows specific uniqueness issues
(like winsock vs. sockets) behind veneer layers so most of the
mainline code didn't have to be touched at all to run on Windows as well 
as the systems it already supported. At the time, I had to support
Linux, OS X, a number of UNIX platforms, Netware and Windows for a suite 
of programs that all used pthreads rather heavily. Getting
pthreads to work on Windows was one of the simpler parts of the
windows port, thanks to the pthreads-win32 effort.

In general, apart from GUI issues, which are always painful to port
(and please, nobody try and make a case for QT here), you have the
same sort of issues in porting to windows regardless of the APIs
you use outside of libc. You end up doing some sort of compile time
platform detection and 'munging' to make Windows bend to your will.
Once you figure that out, it's not as horrible as you think.

> I investigated as far as could on my own, which wasn't very far, since I
> am not a Windows expert, nor do I have any Windows machine I could test
> things on. I found a Microsoft web site which listed dozens of pthreads
> functions that it freely admitted were both required by POSIX, and not
> implemented in the POSIX subsystem for Windows, which would favor the
> statements of the first group I mentioned. However, I couldn't find any
> clear statements on the Microsoft web site about the simultaneous use of
> the POSIX subsystem and Win32. That's not because my searches didn't
> turn up anything - it was  because my searches turned up too much
> information, and I couldn't sift through it to find the particular
> information I was looking for.

If you are interested only in Windows *native* support for pthreads, I
think you will be disappointed, unless they have made significant
changes in recent years. At the time I was still worried about pthreads
on Windows, I was using only externally developed support. I have no
useful information to contribute about Microsoft's direct support for
them, if it exists.

I hope that's at least somewhat helpful, I'm afraid my experience is
rapidly becoming dated.


-- 
Randy Howard
(replace the obvious text in the obvious way if you wish to contact me 
directly)

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[C/POSIX] pthread_exit() JKB <jkb@koenigsberg.invalid> - 2016-07-20 16:47 +0000
  Re: [C/POSIX] pthread_exit() "James R. Kuyper" <jameskuyper@verizon.net> - 2016-07-20 13:42 -0400
    Re: [C/POSIX] pthread_exit() Keith Thompson <kst-u@mib.org> - 2016-07-20 11:33 -0700
    Re: [C/POSIX] pthread_exit() JKB <jkb@koenigsberg.invalid> - 2016-07-21 10:10 +0000
    Re: [C/POSIX] pthread_exit() Randy Howard <rhoward.mx@EverybodyUsesIt.com> - 2016-07-22 08:10 -0500
      Re: [C/POSIX] pthread_exit() JKB <jkb@koenigsberg.invalid> - 2016-07-22 13:42 +0000
        Re: [C/POSIX] pthread_exit() Randy Howard <rhoward.mx@EverybodyUsesIt.com> - 2016-07-22 09:44 -0500
          Re: [C/POSIX] pthread_exit() JKB <jkb@koenigsberg.invalid> - 2016-07-22 14:48 +0000
      Re: [C/POSIX] pthread_exit() Richard Heathfield <rjh@cpax.org.uk> - 2016-07-22 14:52 +0100
      Re: [C/POSIX] pthread_exit() supercat@casperkitty.com - 2016-07-22 08:51 -0700
      Re: [C/POSIX] pthread_exit() James Kuyper <jameskuyper@verizon.net> - 2016-07-22 13:26 -0400
      Re: [C/POSIX] pthread_exit() Keith Thompson <kst-u@mib.org> - 2016-07-22 10:28 -0700
        Re: [C/POSIX] pthread_exit() Ian Collins <ian-news@hotmail.com> - 2016-07-23 16:12 +1200
        Re: [C/POSIX] pthread_exit() Randy Howard <rhoward.mx@EverybodyUsesIt.com> - 2016-07-23 16:43 -0500
          Re: [C/POSIX] pthread_exit() "James R. Kuyper" <jameskuyper@verizon.net> - 2016-07-23 18:17 -0400
            Re: [C/POSIX] pthread_exit() Keith Thompson <kst-u@mib.org> - 2016-07-23 20:45 -0700
            Re: [C/POSIX] pthread_exit() James Kuyper <jameskuyper@verizon.net> - 2016-07-24 07:27 -0400
              Re: [C/POSIX] pthread_exit() Randy Howard <rhoward.mx@EverybodyUsesIt.com> - 2016-07-25 15:22 -0500
                Re: [C/POSIX] pthread_exit() Ian Collins <ian-news@hotmail.com> - 2016-07-26 08:26 +1200
                Re: [C/POSIX] pthread_exit() "James R. Kuyper" <jameskuyper@verizon.net> - 2016-07-25 16:32 -0400
                Re: [C/POSIX] pthread_exit() Randy Howard <rhoward.mx@EverybodyUsesIt.com> - 2016-07-25 15:52 -0500
                Re: [C/POSIX] pthread_exit() "James R. Kuyper" <jameskuyper@verizon.net> - 2016-07-25 16:59 -0400
                Re: [C/POSIX] pthread_exit() Randy Howard <rhoward.mx@EverybodyUsesIt.com> - 2016-07-25 16:36 -0500
  Re: [C/POSIX] pthread_exit() Johann Klammer <klammerj@NOSPAM.a1.net> - 2016-07-21 11:54 +0200
    Re: [C/POSIX] pthread_exit() JKB <jkb@koenigsberg.invalid> - 2016-07-22 08:17 +0000
      Re: [C/POSIX] pthread_exit() JKB <jkb@koenigsberg.invalid> - 2016-07-22 08:47 +0000
  Re: [C/POSIX] pthread_exit() Melzzzzz <mel@zzzzz.com> - 2016-07-23 00:52 +0200
    Re: [C/POSIX] pthread_exit() JKB <jkb@koenigsberg.invalid> - 2016-07-25 11:43 +0000
      Re: [C/POSIX] pthread_exit() Melzzzzz <mel@zzzzz.com> - 2016-07-25 13:47 +0200
        Re: [C/POSIX] pthread_exit() JKB <jkb@koenigsberg.invalid> - 2016-07-25 11:58 +0000
          Re: [C/POSIX] pthread_exit() Melzzzzz <mel@zzzzz.com> - 2016-07-25 14:00 +0200
            Re: [C/POSIX] pthread_exit() JKB <jkb@koenigsberg.invalid> - 2016-07-25 12:18 +0000
              Re: [C/POSIX] pthread_exit() Melzzzzz <mel@zzzzz.com> - 2016-07-25 14:20 +0200
                Re: [C/POSIX] pthread_exit() JKB <jkb@koenigsberg.invalid> - 2016-07-25 12:26 +0000
                Re: [C/POSIX] pthread_exit() Melzzzzz <mel@zzzzz.com> - 2016-07-25 14:28 +0200
                Re: [C/POSIX] pthread_exit() JKB <jkb@koenigsberg.invalid> - 2016-07-25 12:35 +0000
                Re: [C/POSIX] pthread_exit() JKB <jkb@koenigsberg.invalid> - 2016-07-25 13:44 +0000

csiph-web