On inter-thread communications under SDL

I’m having problems in that I use a method for comms from (IIRC) the
democode for IPC.
It uses mutexes to handle locking and conditions to signal available data.

It runs fine if I use it to handle an audio feed (ie : pipe audio packets
to cache, cache empties in another thread). It freezes within a frame or
two if video is enabled.

Does anyone have a -workable- inter-process communication system using
fixed or variable sized messages (either - it doesn’t bother me either
way). Speed (and latency) is -very- important as I’m writing multimedia
streaming code with an independant cache for each media form. (plus
possibly a timing cache - tests have shown it to be good).

IPC messages are a possible way but there’s no SDL equivalent :slight_smile:

and I -might- use TCP/IP for audio but not video as long as caching is
possible!

Ideas? Help?

I’d -really- like platform-portable as I’d like to compile for windows as
well as my native linux :)–
Trying to bring truth from beauty is Winterlion.
find at this winterlions’ page

I’m having problems in that I use a method for comms from (IIRC) the
democode for IPC.
It uses mutexes to handle locking and conditions to signal available data.

It runs fine if I use it to handle an audio feed (ie : pipe audio packets
to cache, cache empties in another thread). It freezes within a frame or
two if video is enabled.

Have you looked at SMPEG’s various mechanisms?

http://www.lokigames.com/development/smpeg.php3

A ring buffer is the easiest mechanism to implement and use.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

I’m having problems in that I use a method for comms from (IIRC) the
democode for IPC.
It uses mutexes to handle locking and conditions to signal available data.

It runs fine if I use it to handle an audio feed (ie : pipe audio packets
to cache, cache empties in another thread). It freezes within a frame or
two if video is enabled.

Have you looked at SMPEG’s various mechanisms?

http://www.lokigames.com/development/smpeg.php3

A ring buffer is the easiest mechanism to implement and use.

Actually - yes. I don’t really like how it handles semaphores but I
suppose it works. it doesn’t if you have just a flat buffer for data
which is how my old audio-feed worked… but if you do a ring of messages
describing offsets to a flat buffer… hmm. Okay, I’ll look into it
again.

BTW - anyone interested in a small library to handle IPC under SDL?
(C++; a message is a subset of a ringbuffer entry, a message queue is
implemented as a ringbuffer?)
(and maybe a CORBA interface as well :slight_smile:

G’day, eh? :slight_smile:
- TeunisOn Wed, 9 Aug 2000, Sam Lantinga wrote:


Trying to bring truth from beauty is Winterlion.
find at this winterlions’ page