\hypertarget{class_s_c_i_run_1_1_work_queue}{\section{Work\-Queue Class Reference}
\label{class_s_c_i_run_1_1_work_queue}\index{Work\-Queue@{Work\-Queue}}
}


{\ttfamily \#include $<$Work\-Queue.\-h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_s_c_i_run_1_1_work_queue_ad08300823b8f7e9f3e7121b09f114508}{Work\-Queue} (const char $\ast$\hyperlink{_boost_graph_example_tests_8cc_a8ad72759d07f18eaf8f6690e5dfb747c}{name})
\begin{DoxyCompactList}\small\item\em Make an empty work queue with no assignments. \end{DoxyCompactList}\item 
void \hyperlink{class_s_c_i_run_1_1_work_queue_a149d3a6c58ac62a4c7fdc2c70c0550ed}{refill} (int total\-Assignments, int nthreads, int granularity=5)
\item 
\hyperlink{class_s_c_i_run_1_1_work_queue_adcd8b5d7dd689b315d4c301e0d78341a}{$\sim$\-Work\-Queue} ()
\begin{DoxyCompactList}\small\item\em Destroy the work queue. Any unassigned work will be lost. \end{DoxyCompactList}\item 
bool \hyperlink{class_s_c_i_run_1_1_work_queue_a28aeaa67b986f2c69e5aea76633e193a}{next\-Assignment} (int \&start, int \&end)
\end{DoxyCompactItemize}


\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_s_c_i_run_1_1_work_queue_ad08300823b8f7e9f3e7121b09f114508}{\index{S\-C\-I\-Run\-::\-Work\-Queue@{S\-C\-I\-Run\-::\-Work\-Queue}!Work\-Queue@{Work\-Queue}}
\index{Work\-Queue@{Work\-Queue}!SCIRun::WorkQueue@{S\-C\-I\-Run\-::\-Work\-Queue}}
\subsubsection[{Work\-Queue}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Work\-Queue} (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{name}
\end{DoxyParamCaption}
)}}\label{class_s_c_i_run_1_1_work_queue_ad08300823b8f7e9f3e7121b09f114508}


Make an empty work queue with no assignments. 

\hypertarget{class_s_c_i_run_1_1_work_queue_adcd8b5d7dd689b315d4c301e0d78341a}{\index{S\-C\-I\-Run\-::\-Work\-Queue@{S\-C\-I\-Run\-::\-Work\-Queue}!$\sim$\-Work\-Queue@{$\sim$\-Work\-Queue}}
\index{$\sim$\-Work\-Queue@{$\sim$\-Work\-Queue}!SCIRun::WorkQueue@{S\-C\-I\-Run\-::\-Work\-Queue}}
\subsubsection[{$\sim$\-Work\-Queue}]{\setlength{\rightskip}{0pt plus 5cm}$\sim${\bf Work\-Queue} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_s_c_i_run_1_1_work_queue_adcd8b5d7dd689b315d4c301e0d78341a}


Destroy the work queue. Any unassigned work will be lost. 



\subsection{Member Function Documentation}
\hypertarget{class_s_c_i_run_1_1_work_queue_a28aeaa67b986f2c69e5aea76633e193a}{\index{S\-C\-I\-Run\-::\-Work\-Queue@{S\-C\-I\-Run\-::\-Work\-Queue}!next\-Assignment@{next\-Assignment}}
\index{next\-Assignment@{next\-Assignment}!SCIRun::WorkQueue@{S\-C\-I\-Run\-::\-Work\-Queue}}
\subsubsection[{next\-Assignment}]{\setlength{\rightskip}{0pt plus 5cm}bool next\-Assignment (
\begin{DoxyParamCaption}
\item[{int \&}]{start, }
\item[{int \&}]{end}
\end{DoxyParamCaption}
)}}\label{class_s_c_i_run_1_1_work_queue_a28aeaa67b986f2c69e5aea76633e193a}
Called by each thread to get the next assignment. If {\itshape next\-Assignment} returns true, the thread has a valid assignment, and then would be responsible for the work from the returned {\itshape start} through {\itshape end-\/l}. Assignments can range from 0 to {\itshape total\-Assignments}-\/1. When {\itshape next\-Assignment} returns false, all work has been assigned. \hypertarget{class_s_c_i_run_1_1_work_queue_a149d3a6c58ac62a4c7fdc2c70c0550ed}{\index{S\-C\-I\-Run\-::\-Work\-Queue@{S\-C\-I\-Run\-::\-Work\-Queue}!refill@{refill}}
\index{refill@{refill}!SCIRun::WorkQueue@{S\-C\-I\-Run\-::\-Work\-Queue}}
\subsubsection[{refill}]{\setlength{\rightskip}{0pt plus 5cm}void refill (
\begin{DoxyParamCaption}
\item[{int}]{total\-Assignments, }
\item[{int}]{nthreads, }
\item[{int}]{granularity = {\ttfamily 5}}
\end{DoxyParamCaption}
)}}\label{class_s_c_i_run_1_1_work_queue_a149d3a6c58ac62a4c7fdc2c70c0550ed}
Fill the work queue with the specified total number of work assignments. {\itshape num\-\_\-threads} specifies the approximate number of threads which will be working from this queue. The optional {\itshape granularity} specifies the degree to which the tasks are divided. A large granularity will create more assignments with smaller assignments. A granularity of zero will recieve a single assignment of approximately uniform size. {\itshape name} should be a static string which describes the primitive for debugging purposes. 

The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Core/\-Thread/\-Legacy/\hyperlink{_core_2_thread_2_legacy_2_work_queue_8h}{Work\-Queue.\-h}\end{DoxyCompactItemize}
