… | |
… | |
267 | |
267 | |
268 | $existing_hash{perl_multicore_api} = "123456781234567812345678"; |
268 | $existing_hash{perl_multicore_api} = "123456781234567812345678"; |
269 | |
269 | |
270 | And that's it, which is, as I think, indeed very little. |
270 | And that's it, which is, as I think, indeed very little. |
271 | |
271 | |
272 | As for code size, on my amd64 system, every call to C<perlinterp_release> |
272 | As for code size and speed, on my amd64 system, every call to |
273 | or C<perlinterp_acquire> results in a variation of the following 9-10 |
273 | C<perlinterp_release> or C<perlinterp_acquire> results in a variation of |
274 | octet sequence: |
274 | the following 9-10 octet sequence which is easy to predict for modern |
|
|
275 | CPUs, as the function pointer is constant after initialisation: |
275 | |
276 | |
276 | 150> mov 0x200f23(%rip),%rax # <perl_multicore_api> |
277 | 150> mov 0x200f23(%rip),%rax # <perl_multicore_api> |
277 | 157> callq *0x8(%rax) |
278 | 157> callq *0x8(%rax) |
|
|
279 | |
|
|
280 | The actual function being called when no backend is installed or enabled |
|
|
281 | looks like this: |
|
|
282 | |
|
|
283 | 1310> retq |
278 | |
284 | |
279 | The biggest part is the initialisation code, which consists of 11 lines of |
285 | The biggest part is the initialisation code, which consists of 11 lines of |
280 | typical XS code. On my system, all the code in F<perlmulticore.h> compiles |
286 | typical XS code. On my system, all the code in F<perlmulticore.h> compiles |
281 | to less than 160 octets of read-only data. |
287 | to less than 160 octets of read-only data. |
282 | |
288 | |