Alright thanks for the ideas! I didn’t think there would be a problem and I didn’t understand why there would be…? Thank you.
Glenn Maynard <g_sdl at zewt.org> wrote:On Fri, Dec 12, 2003 at 04:30:00AM -0500, Drake Wilson wrote:
Can I use regular old pipes between the SDL threads?
I don’t believe so, no. This is a classic IPC problem. This is
Err, of course you can. It’s not the most efficient thing to do (moving
data through a kernel buffer when you’re already in the same memory space),
or the most portable (if you want to work on archs that don’t have pipes),
but it should certainly work (with no extra mutexes or semaphores).
You can use pipes to make a process communicate with itself, eg.
int fd[2];
pipe(fd);
write(fd[1], buf, size);
read(fd[0], buf, size);
and it works just as well if you’re reading in a different thread.
If you want two-directional comms, you’ll need either two pipes or a
socketpair, of course.–
Glenn Maynard
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
To follow the path:
look to the master,
follow the master,
walk with the master,
see through the master,
become the master.
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing