newsAdvanced Gtk+ Sequencer - News: The enormous payload of async UI

 
 
Latest News
GSequencer v3.6.x release goals posted by jkraehemann, Fri 31 Jul 2020 10:17:04 AM UTC - 0 replies
GSequencer v3.4.x release goals posted by jkraehemann, Thu 11 Jun 2020 06:58:14 PM UTC - 0 replies
GSequencer v3.3.x replaced all recalls by ags-fx engine posted by jkraehemann, Wed 20 May 2020 07:25:15 AM UTC - 0 replies
Refactor GSequencer's recalls - the ags-fx engine posted by jkraehemann, Sun 03 May 2020 12:08:19 AM UTC - 0 replies
GSequencer v3.3.x release goals posted by jkraehemann, Fri 17 Apr 2020 12:36:11 PM UTC - 0 replies
[Submit News]
[97 news in archive]

The enormous payload of async UI

Item posted by Joël Krähemann <jkraehemann> on Sun 17 Dec 2017 09:57:51 PM UTC.

Last week I just spent with adding mutices to functions that were never intended to run in parallel. They require to run asynchronous exclusively. E.g. ags_channel_set_link() is such a function. You can't run it at arbitrary time it requires the audio engine not running any AgsRecall implementations. Due to the nested and shared AgsRecycling tree, providing reusable AgsAudioSignal, which would break any concurrent logic.

The nested tree link functions

The payload of the nested tree in code to be written is just enormous. Now it has been 3 days since I started to make some functions related to link AgsChannel thread-safe.

The function ags_channel_set_link() has some related functions:

  • ags_channel_set_recycling()
  • ags_channel_recycling_changed()
  • ags_channel_recursive_set_property()
  • ags_channel_recursive_reset_recall_ids()

Whereas the last is related to these functions:

  • ags_channel_recursive_play_init()
  • ags_channel_tillrecycling_cancel()

ags_channel_recursive_reset_recall_ids() is huge it contains 30 nested functions is over 2000 lines long, at the moment. It is responsible to hot link AgsChannel and set up a running engine. But at most, I think it is the very last function that needs to be thread-safe.

It took 2 more days to make all AgsTask::launch() class to be thread-safe.

Objects need to be locked

In libags-audio these 4 objects need to be protected by a mutex. Accessing properties of them required appropriate lock.

  • AgsSoundcard implementations
  • AgsAudio
  • AgsChannel
  • AgsRecycling

Thought there are more objects that require thread-safety, its mutex is given by libags like for these:

  • AgsSoundcardThread
  • AgsAudioLoop
  • AgsAudioThread
  • AgsChannelThread

Joël

No messages in The enormous payload of async UI

 

Back to the top


Powered by Savane 3.5