2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. _implementing-parallel-construct:
8 Implementing PARALLEL construct
9 *******************************
22 void subfunction (void *data)
29 GOMP_parallel_start (subfunction, &data, num_threads);
35 void GOMP_parallel_start (void (*fn)(void *), void *data, unsigned num_threads)
37 The :samp:`{FN}` argument is the subfunction to be run in parallel.
39 The :samp:`{DATA}` argument is a pointer to a structure used to
40 communicate data in and out of the subfunction, as discussed
41 above with respect to FIRSTPRIVATE et al.
43 The :samp:`{NUM_THREADS}` argument is 1 if an IF clause is present
44 and false, or the value of the NUM_THREADS clause, if
47 The function needs to create the appropriate number of
48 threads and/or launch them from the dock. It needs to
49 create the team structure and assign team ids.
53 void GOMP_parallel_end (void)
55 Tears down the team and returns us to the previous ``omp_in_parallel()`` state.