NamedSemaphore(Int32, Int32, String, Boolean) Constructor

Initializes a new instance of the NamedSemaphore class, specifying the initial number of entries, the maximum number of concurrent entries, the name of a system semaphore object, and specifying a variable that receives a value indicating whether a new system semaphore was created.

Definition

Namespace: Gemstone.Threading
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
public NamedSemaphore(
	int initialCount,
	int maximumCount,
	string name,
	out bool createdNew
)

Parameters

initialCount  Int32
The initial number of requests for the semaphore that can be granted concurrently.
maximumCount  Int32
The maximum number of requests for the semaphore that can be granted concurrently.
name  String
The unique name identifying the semaphore. This name is case-sensitive. Use a backslash (\\) to specify a namespace, but avoid it elsewhere in the name. On Unix-based systems, the name should conform to valid file naming conventions, excluding slashes except for an optional namespace backslash. The name length is limited to 250 characters after any optional namespace.
createdNew  Boolean
When method returns, contains true if the specified named system semaphore was created; otherwise, false if the semaphore already existed.

Remarks

The name may be prefixed with Global\ or Local\ to specify a namespace. When the Global namespace is specified, the synchronization object may be shared with any processes on the system. When the Local namespace is specified, which is also the default when no namespace is specified, the synchronization object may be shared with processes in the same session. On Windows, a session is a login session, and services typically run in a different non-interactive session. On Unix-like operating systems, each shell has its own session. Session-local synchronization objects may be appropriate for synchronizing between processes with a parent/child relationship where they all run in the same session.

See Also