View source code
							
							
						
								Display the source code in std/parallelism.d from which this
								page was generated on github.
							
						
							Report a bug
							
						
								If you spot a problem with this page, click here to create a
								Bugzilla issue.
							
						
							
								Improve this page
							
							
					
								Quickly fork, edit online, and submit a pull request for this page.
								Requires a signed-in GitHub account. This works well for small changes.
								If you'd like to make larger changes you may want to consider using
								local clone.
							
						Function std.parallelism.TaskPool.workerIndex
Gets the index of the current thread relative to this TaskPool.  Any
    thread not in this pool will receive an index of 0.  The worker threads in
    this pool receive unique indices of 1 through this.
						
				ulong workerIndex() nothrow @property @safe const;
						
					
				This function is useful for maintaining worker-local resources.
Example
// Execute a loop that computes the greatest common
// divisor of every number from 0 through 999 with
// 42 in parallel.  Write the results out to
// a set of files, one for each thread.  This allows
// results to be written out without any synchronization.
import stdAuthors
License
					Copyright © 1999-2018 by the D Language Foundation | Page generated by ddox.