This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

labBarrier

Block execution until all workers reach this call

Syntax

labBarrier

Description

labBarrier blocks execution of a parallel algorithm until all workers have reached the call to labBarrier. This is useful for coordinating access to shared resources such as file I/O.

Examples

Synchronize Workers for Timing

When timing code execution on the workers, use labBarrier to ensure all workers are synchronized and start their timed work together.

labBarrier;
tic
    A = rand(1,1e7,'codistributed');
distTime = toc; 

Introduced before R2006a