Function execution types

Function execution timeliness essentially refers to whether or not the operations performed by Screen are immediate or delayed.

Each Screen API function can be categorized by its execution type:
Immediate execution
Immediate execution describes API functions where the command from the function call is executed immediately and isn't queued for batch processing.
Flushing execution
Flushing execution describes API functions where the command from the function call is queued for batch processing, and then the command buffer is immediately flushed to process all queued commands—previously queued ones included.
Delayed execution
Delayed execution describes API functions where the command from the function call is queued for batch processing.
Apply execution
Apply execution describes API functions where the command from the function call is added to the queue for batch processing, and then this queue is immediately flushed to process all queued commands—previously queued ones included. The display is redrawn if necessary.

Most of the Screen API functions aren't executed immediately. Instead, the commands resulting from the function calls are queued at the API for batch processing later in time. As your application makes multiple API function calls, commands accumulate in a command buffer that's associated with a context. These commands are batch-processed either when the command buffer is full, or when an API function of the type flushing execution is called. By batch-processing these commands, a large number of commands can be submitted in one atomic operation and the communication between the client and the Composition Manager is reduced to fewer, larger messages.

However, it's important to note that functions that are executed immediately may additionally flush a set of queued commands. Furthermore, a function that flushes any queued commands may or may not necessarily cause a redraw of the display.

You should understand the exact execution type of each API function. Knowing how and when these functions will be executed in the scope of your Screen application will be fundamental to your development.

Last modified: 2014-05-14



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus