number share_create(number key, number size[, boolean bReadOnly=false])
Parameters
key
the key used to identify the shared memory segment
size
the size of the shared memory segment
bReadOnly
true if the segment cannot be written
Description:
Creates a shared memory segment. In the other process you should call share_open.
Return value:
Returns a shared memory handle. If failed, a run time error is raised. For controlling run-time errors you should set at the beginning of your program: pragma lib_exceptions on
Example
import standard.lib.shared
class Main {
function Main() {
var ctx=share_create(123,0xFF);
echo ctx;
echo share_set(ctx,"test");
echo share_get(ctx);
echo "\n";
var i=0;
while (1) {
i++;
echo "$i:"+share_link_count(ctx)+share_get(ctx)+"\r";
}
}
}