[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: glut/freeglut and fork()



Francesco Orsenigo wrote:
I'd like the game client to spawn a game server: i don't like the idea of launching two things each time i want to play.
The question is: what happens if i fork() from inside glut environment?
Let's say i'm inside the glut idle function, or (worse?) inside an input callback.
Well, so long as you never return from the idle function (or input function)
in the forked task - and never call another GLUT/OpenGL function from within
that fork, you should be OK.

I guess I'd make sure there are no timers or anything running when I forked
and I might even un-register all the GLUT callbacks before doing the fork.

What happens?
Is it just a strange thing to do, or is it really a *bad* one?
I think it'll be fine.

---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1@airmail.net>    WorkEmail: <sjbaker@link.com>
HomePage : http://www.sjbaker.org
Projects : http://plib.sf.net    http://tuxaqfh.sf.net
           http://tuxkart.sf.net http://prettypoly.sf.net
-----BEGIN GEEK CODE BLOCK-----
GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M-
V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++
-----END GEEK CODE BLOCK-----