Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Consider the way you want to distribute the information and potential overlaps - if it takes longer for any of the readers to finish reading than it takes for a refresh then you are going to get in trouble with the suggested approach.</p> <p>The way I read your question, there are multiple readers, the writer doesn't know (or care in most part) how many readers there are at one time, but wants to notify the readers that something new is available to read. </p> <p>Without knowing how many potential readers there are you can't use a simple mutex or semaphore to know when the readers are done, without knowing when everybody is done you don't have good info on when to reset an event to notify for the next read event.</p> <p><strong>MS Windows specific:</strong></p> <p><em>Shared Segments</em><br> One option is to place variables within a shared data segment. That means that the same variables can be read (and written to) by all exe's that have named the same segment or if you put it into a DLL - loaded the shared DLL.</p> <p>See <a href="http://www.codeproject.com/KB/DLL/data_seg_share.aspx" rel="nofollow">http://www.codeproject.com/KB/DLL/data_seg_share.aspx</a> for more info.</p> <pre><code>// Note: Be very wary of using anything other than primitive types here! #pragma data_seg(".mysegmentname") HWND hWnd = NULL; LONG nVersion = -1; #pragma data_seg() #pragma comment(linker, "/section:.mysegmentname,rws") </code></pre> <p><em>IPC - COM</em><br> Make your main app a com service where the workers can register with for events, push out the change to each event sink.</p> <p><em>IPC - dual events</em><br> Assuming any 1 read cycle is much less than time between write events. create 2 manual reset events, at any time at most 1 of those events will be signaled, alternate between events. signaling will immediatly release all the readers and once complete they will wait on the alternate event.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload