Concept Framework 2.2 documentation Contents | Index

standard.lib.shared.share_create

Name Version Deprecated
share_create version 1.0 no

Prototype:
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.

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";
		}
	}
}

Returns:
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

Documented by Eduard Suica, generation time: Sun Jan 27 18:15:17 2013 GMT(c)2013 Devronium Applications