SDL Digest, Vol 53, Issue 28

Ok, I probe that ‘dummy’ - I guess you mean the src/generic/SDL_syscond.c
code. Anyway, I think SDL_syscond.c is put into src/thread/generic by
mistake, since it contains WINAPI calls like CreateSemaphoreCE() etc.
Furthermore, it’s not included in the VisualC project that comes with SDL
package. I think it should be put in src/thread/windows/ and included in
.vcproj, and there should by some stub implementation in generic/ for
SDL_Cond* interface instead - like it is made for SDL_CreateThread there:

/* src/generic/SDL_systhread.c */

int
SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
{
SDL_SetError(“Threads are not supported on this platform”);
return (-1);
}

Note that I’m on SDL 1.3.0-5538.

2011/5/10 > Send SDL mailing list submissions to

   sdl at lists.libsdl.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
or, via email, send a message with subject or body ‘help’ to
sdl-request at lists.libsdl.org

You can reach the person managing the list at
sdl-owner at lists.libsdl.org

When replying, please edit your Subject line so it is more specific
than “Re: Contents of SDL digest…”

Today’s Topics:

  1. Re: [SDL_threads] SDL_CondCreate equivalent for WIN32
    missing? (Patrick Baggett)
  2. Re: [SDL_threads] SDL_CondCreate equivalent for WIN32
    missing? (Nathaniel J Fries)

---------- P?eposlan? zpr?va ----------
From: Patrick Baggett <baggett.patrick at gmail.com>
To: SDL Development List
Date: Tue, 10 May 2011 11:06:11 -0500
Subject: Re: [SDL] [SDL_threads] SDL_CondCreate equivalent for WIN32
missing?
Condition variables aren’t natively supported by Windows until Windows 7 (l
ink http://msdn.microsoft.com/en-us/library/ms682052(v=vs.85).aspx) and
emulation of them isn’t perfect for versions < 7; the topic is already well
researched (link http://www1.cse.wustl.edu/~schmidt/win32-cv-1.html). I
thought thread/generic/ had implementations of CVs using other primitives
and that they were available for Win32 (I seem to recall a friend of mine
using them on Win32 before). Are you sure those aren’t being compiled in?

Patrick

On Tue, May 10, 2011 at 7:48 AM, Pete Lefis <@Pete_Lefis> wrote:

Hello,

I’m planning to use SDL_Cond* API in my code, but for windows-based
platforms, its implementation is missing. I’ve already noticed this post
http://forums.libsdl.org/viewtopic.php?t=4445&start=0&postdays=0&postorder=asc&highlight=sdlcondsignalfrom 2009. Could the age of that post mean, that there will be no
implementation e.g. through CreateEvent, SetEvent, WaitForObject,… Windows
APIs in near future?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

---------- P?eposlan? zpr?va ----------
From: “Nathaniel J Fries”
To: sdl at lists.libsdl.org
Date: Tue, 10 May 2011 11:53:44 -0700
Subject: Re: [SDL] [SDL_threads] SDL_CondCreate equivalent for WIN32
missing?
You have to use the ‘dummy’ condition code. While the win32 "event"
functions generally operate as a condition, they do not feature everything
expected and as such can’t be used without breaking old code.
SDL aims to support as many targets as possible, and it is difficult for
the developer using SDL to make two releases (one for >Win7, another for
<=Win7).


EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Sorry for my mystification, the generic SDL_syscond.c uses
CreateSemaphore(), but it’s not right that the code itslef is present in
this file… so everythoing correct for me, just except that I had to
hardwire the module into the project manually…

2011/5/11 Pete Lefis <@Pete_Lefis>> Ok, I probe that ‘dummy’ - I guess you mean the src/generic/SDL_syscond.c

code. Anyway, I think SDL_syscond.c is put into src/thread/generic by
mistake, since it contains WINAPI calls like CreateSemaphoreCE() etc.
Furthermore, it’s not included in the VisualC project that comes with SDL
package. I think it should be put in src/thread/windows/ and included in
.vcproj, and there should by some stub implementation in generic/ for
SDL_Cond* interface instead - like it is made for SDL_CreateThread there:

/* src/generic/SDL_systhread.c */

int
SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
{
SDL_SetError(“Threads are not supported on this platform”);
return (-1);
}

Note that I’m on SDL 1.3.0-5538.

2011/5/10

Send SDL mailing list submissions to
sdl at lists.libsdl.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
or, via email, send a message with subject or body ‘help’ to
sdl-request at lists.libsdl.org

You can reach the person managing the list at
sdl-owner at lists.libsdl.org

When replying, please edit your Subject line so it is more specific
than “Re: Contents of SDL digest…”

Today’s Topics:

  1. Re: [SDL_threads] SDL_CondCreate equivalent for WIN32
    missing? (Patrick Baggett)
  2. Re: [SDL_threads] SDL_CondCreate equivalent for WIN32
    missing? (Nathaniel J Fries)

---------- P?eposlan? zpr?va ----------
From: Patrick Baggett <baggett.patrick at gmail.com>
To: SDL Development List
Date: Tue, 10 May 2011 11:06:11 -0500
Subject: Re: [SDL] [SDL_threads] SDL_CondCreate equivalent for WIN32
missing?
Condition variables aren’t natively supported by Windows until Windows 7
(link http://msdn.microsoft.com/en-us/library/ms682052(v=vs.85).aspx)
and emulation of them isn’t perfect for versions < 7; the topic is already
well researched (linkhttp://www1.cse.wustl.edu/~schmidt/win32-cv-1.html).
I thought thread/generic/ had implementations of CVs using other primitives
and that they were available for Win32 (I seem to recall a friend of mine
using them on Win32 before). Are you sure those aren’t being compiled in?

Patrick

On Tue, May 10, 2011 at 7:48 AM, Pete Lefis <@Pete_Lefis> wrote:

Hello,

I’m planning to use SDL_Cond* API in my code, but for windows-based
platforms, its implementation is missing. I’ve already noticed this post
http://forums.libsdl.org/viewtopic.php?t=4445&start=0&postdays=0&postorder=asc&highlight=sdlcondsignalfrom 2009. Could the age of that post mean, that there will be no
implementation e.g. through CreateEvent, SetEvent, WaitForObject,… Windows
APIs in near future?


SDL mailing list
SDL at lists.libsdl.org

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

---------- P?eposlan? zpr?va ----------
From: “Nathaniel J Fries”
To: sdl at lists.libsdl.org
Date: Tue, 10 May 2011 11:53:44 -0700
Subject: Re: [SDL] [SDL_threads] SDL_CondCreate equivalent for WIN32
missing?
You have to use the ‘dummy’ condition code. While the win32 "event"
functions generally operate as a condition, they do not feature everything
expected and as such can’t be used without breaking old code.
SDL aims to support as many targets as possible, and it is difficult for
the developer using SDL to make two releases (one for >Win7, another for
<=Win7).


EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/


SDL mailing list
SDL at lists.libsdl.org

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org