\hypertarget{threads_8c}{}\doxysection{threads.\+c File Reference}
\label{threads_8c}\index{threads.c@{threads.c}}


\doxysubsection{Detailed Description}
Routines for the interface of FORM with the pthreads library

This is the main part of the parallelization of TFORM. It is important to also look in the files \mbox{\hyperlink{structs_8h}{structs.\+h}} and \mbox{\hyperlink{variable_8h}{variable.\+h}} because the treatment of the A and B structs is essential (these structs are used by means of the macros AM, AP, AC, AS, AR, AT, AN, AO and AX). Also the definitions and use of the macros BHEAD and PHEAD should be looked up.

The sources are set up in such a way that if WITHPTHREADS isn\textquotesingle{}t defined there is no trace of pthread parallelization. The reason is that TFORM is far more memory hungry than sequential FORM.

Special attention should also go to the locks. The proper use of the locks is essential and determines whether TFORM can work at all. We use the LOCK/\+UNLOCK macros which are empty in the case of sequential FORM These locks are at many places in the source files when workers can interfere with each others data or with the data of the master. 