[Scummvm-devel] Threading issues and mutexes :-)

Lionel Ulmer lionel.ulmer at free.fr
Mon Jun 3 01:54:04 CEST 2002


> Probably wouldn't make any sense to implement mutexes in the Dreamcast
> port since it doesn't implement threads. 

Well, how do you implement sound output then ? The problem I have is not
with MIDI, but on the streaming audio in TheDig or FullThrottle : ie
ScummVM's engine is modifying the data in one mixer while the sound thread
may well be using it.

Now that I think of it, the best way would be to move all the Mixer stuff in
the OSystem interface (why not a OSystem_SND one :-) ) thus the mutex stuff
would remain private to this interface and we would not have to make
hypothesises on how the OSystem class is implementing sound output in the
engine itself.

> Would it be possible to
> somehow separate the MIDI code from the threads stuff so it is
> possible to use it with another process model than threads?  On the
> Dreamcast it would make the most sense to run it on the sound CPU,
> which has its own address space and instrucion set, meaning no shared
> variables or object files with the rest of the code...

Putting the starting of the MIDI thread in the MIDI driver itself is on my
TODO list. This way, you could handle this periodic timer in the driver
itself without resorting to threads if you do not need them.

                 Lionel

-- 
		 Lionel Ulmer - http://www.bbrox.org/




More information about the Scummvm-devel mailing list