Edit description of concurrency model
This commit is contained in:
parent
8e5f5a38d9
commit
eef91c0cf7
1 changed files with 13 additions and 4 deletions
|
|
@ -30,15 +30,24 @@ struct threadInfo {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Concurrency model explained:
|
* Concurrency model explained:
|
||||||
* One reader thread (the GUI thread) of the pixel buffer, along with many
|
* One main thread, along with many workers in a thread pool, who split the work of
|
||||||
* writers, who split the work of rendering roughly equally. The writers don't
|
* rendering roughly equally. The writers don't do any work until the pixel map which they
|
||||||
* do any work until the pixel map which they are meant to work on is marked as
|
* are meant to work on is marked as available, and they are all singalled to start
|
||||||
* available.
|
* drawing.
|
||||||
*
|
*
|
||||||
* Once it is marked as such, this means that the planeView structure is well
|
* Once it is marked as such, this means that the planeView structure is well
|
||||||
* defined, that pixmap points to a memory region, which is allocated with
|
* defined, that pixmap points to a memory region, which is allocated with
|
||||||
* enough memory for the plain view, and they can all start writing without an
|
* enough memory for the plain view, and they can all start writing without an
|
||||||
* issue.
|
* issue.
|
||||||
|
*
|
||||||
|
* Once they are all finished, the last thread to exit the drawing function will signal
|
||||||
|
* the main thread to "blit" the finished image to the screen.
|
||||||
|
*
|
||||||
|
* If any kind of change by the user happens (window resize, panning/zooming (TODO: not
|
||||||
|
* implemented yet), the main thread will cause all worker threads to stop working, if
|
||||||
|
* they haven't already (they occassionally poll while drawing to see if they should
|
||||||
|
* stop). Once they've all stopped, the main thread will update and replace the drawing
|
||||||
|
* area, and naturally, signal them to start drawing again.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pthread_mutex_t pixmapMutex;
|
pthread_mutex_t pixmapMutex;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue