By: rwessel (robertwessel.delete@this.yahoo.com), December 7, 2014 2:34 am
Room: Moderated Discussions
Klimax (danklima.delete@this.gmail.com) on December 6, 2014 5:49 am wrote:
> Eric Bron (eric.bron.delete@this.zvisuel.privatefortest.com) on December 6, 2014 4:25 am wrote:
> > > On windows it's more complicated, as GCC stil tries to generate winxp compatible
> > > code, so it assumes no critical section support.
> >
> > I can't understand why since Windows XP has full critical sections support (in WinBase.h
> > AFAIK) already, as Windows 2000, I suppose it applies to very old Windows version
> >
>
> Ii seems that would have to be very old version. Maybe Win 3.x.
Critical sections were in NT3.1 and Win95, so right from the very beginning. Since 16 bit Windows did not support preemptive multitasking or multiple CPUs, there was no such function in the API. Win16 and Win32 are sufficiently different (*especially* as regards threading) that there is no real question of a Win16 implementation limitation affecting the threading implementation of a Win32 application.
I'm not 100% sure how Win32s (the Win32 emulation layer for Windows 3.1) supported critical sections (probably just always "succeeded"), but as it didn't support threading at all, it probably wouldn't have made much difference. Nor was Win32s all that commonly used.
It's also possibly there were some oddities in critical section support in (early versions of) Windows CE (and some of the things based on that), as threading support was somewhat limited there, but that would have impacted rather few programs.
> Eric Bron (eric.bron.delete@this.zvisuel.privatefortest.com) on December 6, 2014 4:25 am wrote:
> > > On windows it's more complicated, as GCC stil tries to generate winxp compatible
> > > code, so it assumes no critical section support.
> >
> > I can't understand why since Windows XP has full critical sections support (in WinBase.h
> > AFAIK) already, as Windows 2000, I suppose it applies to very old Windows version
> >
>
> Ii seems that would have to be very old version. Maybe Win 3.x.
Critical sections were in NT3.1 and Win95, so right from the very beginning. Since 16 bit Windows did not support preemptive multitasking or multiple CPUs, there was no such function in the API. Win16 and Win32 are sufficiently different (*especially* as regards threading) that there is no real question of a Win16 implementation limitation affecting the threading implementation of a Win32 application.
I'm not 100% sure how Win32s (the Win32 emulation layer for Windows 3.1) supported critical sections (probably just always "succeeded"), but as it didn't support threading at all, it probably wouldn't have made much difference. Nor was Win32s all that commonly used.
It's also possibly there were some oddities in critical section support in (early versions of) Windows CE (and some of the things based on that), as threading support was somewhat limited there, but that would have impacted rather few programs.