Menu

threads

Attachments
AGS_threads.png (203916 bytes)

Multi-Threaded Tree

Ags is a able to run in a super threaded fashion. AgsThread object is therefore the most basic thread which will let run your very own thread within the tree. For locking the tree you must wait until every mutex is acquired.

Well-Known Threads

Diagram

Syncing With AgsAudioLoop

Every child thread of AgsAudioLoop will be synced as long you don't write your very own start class function of AgsThread. The thread is running as long as AGS_THREAD_RUNNING is set as flag. Put your own thread routine by overwriting class function run of AgsThreadClass.

Interfacing Audio-Layer with GUI-Layer and vice versa

At topmost there's AgsAudioLoop whereby AgsTaskThread guarantees no concurrent memory access.
To run tasks instantiate subclass of AgsTask and add to queue by calling:

  • ags_task_thread_append_task()
  • ags_task_thread_append_tasks()

Thread-Pool

The thread pool can be used to pull threads of AGS_TYPE_RETURNABLE_THREAD. It should return as soon as possible because of potential hang-up. It is recommended to stop thread after very first run.


Related

Blog: 2014/05/doing-some-wiki-for-developers
Wiki: development

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.