fluid-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[fluid-dev] Some more thread safety commits and stuff


From: josh
Subject: [fluid-dev] Some more thread safety commits and stuff
Date: Sun, 13 Sep 2009 18:20:18 -0700
User-agent: Internet Messaging Program (IMP) H3 (4.1.6)

I just committed a bunch of multi-thread safety changes to the fluidsynth_event_queue branch. I tested things briefly and all seemed well, but there could still be some bugs.

Notable changes:

fluid_hash.[ch] re-written from recent glib and now has the full power of a generic hash data type (not hard coded to string keys and fluid_settings_t values as before).

Added SoundFont reference counting, presets now add references to SoundFonts. SoundFonts are only unloaded after all presets relinquish their references.

fluid_settings_t is now thread safe.

Converted fluid_mutex_t to use glib's recursive mutex, to prevent recursive deadlocks (possible with fluid_settings_t update() callbacks, if any settings functions are accessed in the update handler).



I realize now that we have probably missed the Ubuntu deadline that David had mentioned. In hindsight, we should probably have released a 1.0.10 without the more ambitious thread safety changes. I'm going to continue plugging away at making FluidSynth thread safe, which I think we are close to now, but we should perhaps still consider the option of releasing a 1.0.10 version. When the thread safe changes are complete, there is likely a bit of testing that is in order to make sure there aren't any issues, since the changes are not so trivial.

As to the previous discussion about glib dependency. I have once again flip-flopped on my decision. It seems to me that the features we want to use from glib are minimal (hash tables, lists and threading related data types). I started disliking the idea of using glib directly, since FluidSynth is already designed as a library that is supposed to handle out of memory conditions. I don't like the idea of another application being terminated by glib, when a memory allocation fails. So I would like to port the needed code from glib to FluidSynth and change as necessary. This will also resolve any build issues or other pains caused by having to build glib and make the embedded FluidSynth case easier.

Testing results on the fluidsynth_event_queue branch would be appreciated! Perhaps we should merge it back into trunk soon?

Comments?

Best regards,
Josh





reply via email to

[Prev in Thread] Current Thread [Next in Thread]