#9457: API for Obtaining Cursor Shape Bitmap and Change Notification ----------------------------------+---------------------------- Reporter: AGMS | Owner: axeld Type: enhancement | Status: new Priority: normal | Milestone: R1 Component: Servers/app_server | Version: R1/Development Resolution: | Keywords: cursor, vnc Blocked By: | Blocking: Has a Patch: 0 | Platform: All ----------------------------------+---------------------------- Comment (by AGMS): A simpler and very fast way of passing around the dirty rectangles would be to have a global fixed size array of rectangles (used as a circular buffer) and a global counter identifying the next rectangle to be written by the app_server. Client programs have their own copy of the counter to keep track of where they are in the rectangle list. So that clients can detect missing too many updates (missed more than the array size), the app_server just keeps on incrementing the counter up to infinity. Everyone would use the count modulo the array size for indexing the array (so the array should be a power of two in size). No need for a separate update thread or the worry about lost BMessages when activity gets too intense. For safety, the array and counter would be in a read only memory area for the clients. An atomic add/fetch would be used to update/read the counter and the app_server would write the new rectangle before updating the counter. It does mean that the clients would be polling the counter to check for rectangles, rather than getting a callback or BMessage when there's a new rectangle. But most of these clients would be doing an update of some sort every frame anyway. -- Ticket URL: <http://dev.haiku-os.org/ticket/9457#comment:4> Haiku <http://dev.haiku-os.org> Haiku - the operating system.