StackThreads/MP: version 0.77 User's Guide
ST_POLLING();
Although it does not have any instantly visible effect, you must make sure that this macro is periodically called. It does two tasks. One is to check if a thread migration request from an idle processor is coming and respond to it if any. The other is to free some stack frames. See Where should you insert ST POLLING for where to insert this in your program.
Do not worry so much about the overhead of ST_POLLING
. If all the
workers are already busy and you do not have to free any stack frame,
the overhead is something like 10 -- 20 instructions.