Note that there are some explanatory texts on larger screens.

plurals
  1. POImplementing a job list with internal synchronisation
    text
    copied!<p>I'm working on a simple job threading framework which is very similar to the one described in <a href="http://s09.idav.ucdavis.edu/talks/05-JP_id_Tech_5_Challenges.pdf" rel="nofollow noreferrer" title="id tech 5 challanges">id Tech 5 Challenges</a>. On the most basic level, I have a set of lists of jobs, and I want to schedule these list across a bunch of CPU threads (using a standard thread pool for the actual dispatching.) However, I wonder how this signal/wait stuff inside a wait list can be efficiently implemented. As I understand it, the wait token blocks the list execution if the signal token has not been executed. This implicitly means that everything before a signal has to finish before the signal can be raised. So let's say we have a list like this:</p> <pre><code>J1, J2, S, J3, W, J4 </code></pre> <p>then the dispatching can go like this:</p> <pre><code>#1: J1, J2, J3 &lt;wait for J1, J2, run other lists if possible&gt; #2: J4 </code></pre> <p>However, this ain't that easy as it seems, as given a set of lists, I would have to move some of them between <code>ready</code> and <code>waiting</code> and also have special code to gather all jobs before a signal and tag something onto them, so that they can trigger the signal if and only if they have all finished (meaning for instance that it's no longer possible to add jobs to the list <em>while</em> it is executed, as following signals access the previously inserted jobs.)</p> <p>Is there any "standard" way of implementing this efficiently? I also wonder how to best schedule the job list execution, right now, each core grabs a job list, and schedules all jobs in it, which gives pretty good scaling (for 32k jobs à 0.7 ms, I get 101%, which I guess is partly due to the fact that the single threaded version is being scheduled onto different cores some times.)</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