Is there any way to let the cpu handle some operations in PHP (quite like openCL) but is available in native php (without having PHP-openCL implemented)?
/E:
What i mean:
I am coding some php cli scripts
Everything you do in php (variables, etc.) will be cached in the ram. But you still can access the RAM directly (shmop – Link), which makes it way faster. (This is an example to access deep system resources, i just want to know if there are ways to access other deep system resources)
I want to acces the CPU directly for having speed up some operations by doing so. (in context of multithreading (pcntl_fork and running inside an endless while-loop in php cli script). Is there a way to skip the c-handler (dunno if this is the right expression).
OpenCL was just an example =)
shmopis not “accessing memory directly” (it’s sharing memory) and “bypassing the C layer” is not “accessing the CPU more directly”.The only thing that may remotely make sense is that you wish to code in ASM directly, instead of writing code in a higher level language which gets compiled down to machine code eventually. This is useful if you think you understand the CPU better than a C/PHP compiler and can write more efficient code for it (in your case, I’d have my doubts, to be honest). If so, you’ll have to write an external application in said low-level language and invoke it from PHP. In C and some other languages you could write inline-ASM, but PHP doesn’t support that.