This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/33578] __gnu_parallel::yield broken on mingw32
- From: "dannysmith at users dot sourceforge dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Oct 2007 23:54:38 -0000
- Subject: [Bug libstdc++/33578] __gnu_parallel::yield broken on mingw32
- References: <bug-33578-4066@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from dannysmith at users dot sourceforge dot net 2007-10-09 23:54 -------
(In reply to comment #2)
> Created an attachment (id=14332)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14332&action=view) [edit]
> Consistent use of _WIN32 define
>
Thats not quite right. ___MINGW32__ defines _WIN32 but doesn't have an
intrin.h. I believe that is for MSVC compiler specific intrinsics. _MSC_VER
is a MSVC compiler builtin define.
Also, Cygwin __may__ define _W32 (with -mwin32 switch) but still should use
its own implementation of <sched.h> and sched_yield since it uses pthreads
I'll attach what I'm using currently. Putting more #ifdef's into this file
certainly doesn't make it any prettier. If wanted, I could prepare a patch that
gets rid of *all* the non-GNU (Windows) stuff and just put a __MINGW32__
specific definition of a __gnu_parallel::sched_yield() into os_defines.h.
FWIW, boost uses Sleep(1) -- not Sleep(0) -- for sched_yield() on windows,
while cygwin use SwitchToThread()
Dann\y
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33578