\section{THREADID Get Current Thread Handle}

\subsection{Usage}

The \verb|threadid| function in FreeMat tells you which thread
is executing the context you are in.  Normally, this is thread
1, the main thread.  However, if you start a new thread using
\verb|threadnew|, you will be operating in a new thread, and functions
that call \verb|threadid| from the new thread will return their 
handles.
\subsection{Example}

From the main thread, we have
\begin{verbatim}
--> threadid

ans = 

 2 


\end{verbatim}
But from a launched auxilliary thread, we have
\begin{verbatim}
--> t_id = threadnew

t_id = 

 3 

--> id = threadcall(t_id,1000,'threadid')

id = 

 3 

--> threadfree(t_id);

\end{verbatim}
