fluid-dev
[Top][All Lists]
Advanced

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

[fluid-dev] Re: FluidSynth event queue and thread safety changes


From: josh
Subject: [fluid-dev] Re: FluidSynth event queue and thread safety changes
Date: Tue, 25 Aug 2009 23:41:35 -0700
User-agent: Internet Messaging Program (IMP) H3 (4.1.6)

I've been looking over the SoundFont and preset code in FluidSynth. Here is what I'm currently thinking of doing to resolve the threading issues:

- Add a hash table using the SoundFont ID as the key, which is protected by the Synth mutex. - Create new structure which is used as values in the hash table, allows for additional fields to be applied to SoundFont instances and merge the SoundFont bank offset list functionality into it:

struct _fluid_sfont_priv_t
{
  int refcount;
  int bank_offset;
};

- When a Preset is created, a reference is added to its owning SoundFont and removed when the preset is destroyed

- Presets shouldn't be destroyed in synthesis thread, due to memory free(), so add another queue which goes in the other direction (synth thread to some main thread process), preset destroy events could then be sent.

Not quite as elegant as I'd like, but I can't think of a better way to do it properly and retain the current API.

I haven't yet thought through, how this "main" or other thread will actually go about processing the events sent from the synthesis thread.

Just wanted to run this by you, to see if you had any better ideas or see any problems with it.

Cheers!

Josh





reply via email to

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