Skip to content

Architecture: Threading

localghost edited this page Jun 5, 2014 · 45 revisions

Tasks

Information related to tasks can be found here.

Global threads

There will probably be a couple of threads that would be accessed by different classes, e.g. thread through which all the libspotify API calls should be made.

List of global threads:

  • spotify_thread : all the libspotify API calls should be done through this thread

Things to reconsider

Queue a task to a not running thread?

Possible solutions for adding tasks to a not running thread:

  • Add a task so that it is executed whenever the thread is started
  • Change the function's signature to return bool(false) and do not add task to the queue
  • Assert when thread is not running (current approach)
  • Throw exception if thread is not running
Clone this wiki locally