… | |
… | |
300 | efficient when not needed, low code and data size overhead and broad |
300 | efficient when not needed, low code and data size overhead and broad |
301 | applicability. |
301 | applicability. |
302 | |
302 | |
303 | =back |
303 | =back |
304 | |
304 | |
|
|
305 | |
|
|
306 | =head1 DISABLING PERL MULTICORE AT COMPILE TIME |
|
|
307 | |
|
|
308 | You can disable the complete perl multicore API by defining the |
|
|
309 | symbol C<PERL_MULTICORE_DISABLE> to C<1> (e.g. by specifying |
|
|
310 | F<-DPERL_MULTICORE_DISABLE> as compiler argument). |
|
|
311 | |
|
|
312 | This will leave no traces of the API in the compiled code, suitable |
|
|
313 | "empty" C<perl_release> and C<perl_acquire> definitions will be provided. |
|
|
314 | |
|
|
315 | This could be added to perl's C<CPPFLAGS> when configuring perl on |
|
|
316 | platforms that do not support threading at all for example. |
|
|
317 | |
|
|
318 | |
305 | =head1 AUTHOR |
319 | =head1 AUTHOR |
306 | |
320 | |
307 | Marc A. Lehmann <perlmulticore@schmorp.de> |
321 | Marc A. Lehmann <perlmulticore@schmorp.de> |
308 | http://perlmulticore.schmorp.de/ |
322 | http://perlmulticore.schmorp.de/ |
309 | |
323 | |
… | |
… | |
315 | license: L<https://creativecommons.org/publicdomain/zero/1.0/>. |
329 | license: L<https://creativecommons.org/publicdomain/zero/1.0/>. |
316 | |
330 | |
317 | =cut |
331 | =cut |
318 | |
332 | |
319 | */ |
333 | */ |
|
|
334 | |
|
|
335 | #if PERL_MULTICORE_DISABLE |
|
|
336 | |
|
|
337 | #define perlinterp_release() do { } while (0) |
|
|
338 | #define perlinterp_acquire() do { } while (0) |
|
|
339 | |
|
|
340 | #else |
320 | |
341 | |
321 | /* this struct is shared between all modules, and currently */ |
342 | /* this struct is shared between all modules, and currently */ |
322 | /* contain only the two function pointers for release/acquire */ |
343 | /* contain only the two function pointers for release/acquire */ |
323 | struct perl_multicore_api |
344 | struct perl_multicore_api |
324 | { |
345 | { |
… | |
… | |
369 | /* call the real (or dummy) implementation now */ |
390 | /* call the real (or dummy) implementation now */ |
370 | perlinterp_release (); |
391 | perlinterp_release (); |
371 | } |
392 | } |
372 | |
393 | |
373 | #endif |
394 | #endif |
|
|
395 | |
|
|
396 | #endif |