[SDL] [Framework] Event-based Networking

Forest Hale havoc at ghdigital.com
Mon Mar 18 09:19:32 PDT 2013


On 03/18/2013 05:30 AM, Glocke wrote:
> Jared Maddox wrote:
> Incidentally, where are you getting SDL_KillThread from? The only sign
> of it that I see is for SDL 1.2
> 
> I am using SDL 1.2 ^^

>From experience porting apps from Windows to Linux and OSX, the platforms that have KillThread functionality have giant hazard warnings in the API docs, because it leaks resources (it does not
terminate the thread cleanly and leaves it hanging around in the process table until the parent exits).

So as a matter of design NEVER kill threads!  You need to tell them to exit by other means (and remember mutex is not the only synchronization primitive in your toolbox - semaphores and condvars have
significant utility).

-- 
LordHavoc
Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/darkplaces
Co-designer of Nexuiz - http://alientrap.org/nexuiz
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass
"A game is a series of interesting choices." - Sid Meier




More information about the SDL mailing list