Establishes point table concurrency control for threaded client applications
Usage syntax
LONG SE_ptable_set_concurrency (SE_PTABLE ptable, LONG policy);
Parameters
ptable |
The handle to a point table |
policy |
The concurrency policy |
Description
SE_ptable_set_concurrency sets the concurrency policy for a particular
point table. The concurrency policy affects how calls to the API for this
point table behave in a multithreaded environment.
The policies for concurrency are:
- SE_UNPROTECTED_POLICYArcSDE provides no protection. Calls by multiple threads to the same handle
could cause problems, but there is no overhead.
- SE_ONE_THREAD_POLICYThe handle is owned by the calling thread, and a call by another thread
immediately returns with an error code of
SE_CONNECTION_LOCKED.
The owning thread must yield ownership by calling this function with an
argument other than SE_ONE_THREAD_POLICY before another thread can use
this handle. If the owning thread terminates, then it automatically releases
its ownership.
- SE_TRYLOCK_POLICYWhenever an ArcSDE function with a connection or stream argument is entered,
the entering thread tries to lock. If it succeeds, it proceeds; if it
fails, it immediately returns with an error code of SE_CONNECTION_IN_USE.
- SE_LOCK_POLICYSimilar
to SE_TRYLOCK_POLICY, but instead of failing if the connection is currently
in use, the call hangs until the thread that has the connection currently
locked returns from its ArcSDE function call. If multiple threads are
waiting on the connection, it is impossible to determine which thread
will get the lock next.
The environment set by SE_ptable_set_concurrency
applies to subsequent calls to SE_ptable_set_concurrency. For safety in
a multithreaded environment, call SE_ptable_set_concurrency on the point
table before passing it to any other thread than the one that created
the point table.
Returns
SE_SUCCESS
SE_FAILURE
SE_INVALID_PARAM_VALUE
SE_INVALID_POINTER
SE_OUT_OF_MUTEXES