 |
PK_THREAD_chain_start |
|
PK_ERROR_code_t PK_THREAD_chain_start
(
--- received arguments ---
PK_THREAD_chain_type_t type,
const PK_THREAD_chain_start_o_t *options
)
This function starts chaining Parasolid functions in the calling thread.
The exclusivity of this function is dynamic and corresponds with the value
of 'type'.
Specific Errors:
PK_ERROR_not_stopped Chaining has already been started (MILD)
PK_ERROR_recursion_depth Called within an outer PK or KI function (MILD)
A chain is a set of multiple, contiguous Parasolid functions called from a
single application thread, which has the same application thread protection as
a single Parasolid function. It can improve performance at the cost of
responsiveness.
Chains can consist of a single link containing all functions or can be split
into multiple shorter links, each containing one or more functions. This
allows other application threads to execute any other Parasolid functions
between links.
A chain starts from when this function is entered until PK_THREAD_chain_stop
is called in this thread, with all intermediate Parasolid functions chained.
If the option 'length' is specified and is > 0, then chains will be split so
that at most that number of Parasolid functions will be in each link.
Whilst in a thread chain, threads cannot lock or unlock partitions, and
applications should avoid waiting for other threads that can call Parasolid.
A thread with locked partitions may start a thread chain. However, if it is
an exclusive thread chain, it will exclude all other threads, including those
with locked partitions.
Only outermost Parasolid functions are counted in a chain. PK functions that
are never counted in a chain are:
PK_MEMORY_alloc
PK_MEMORY_free
PK_SESSION_abort
PK_SESSION_ask_function
PK_SESSION_ask_kernel_version
PK_SESSION_ask_schema_version
PK_SESSION_is_in_kernel
PK_SESSION_is_in_kernel_2
PK_SESSION_register
PK_SESSION_tidy
PK_THREAD_ask_exclusion
PK_THREAD_ask_function
PK_THREAD_ask_id
PK_THREAD_clear_exclusion
PK_THREAD_is_in_chain
PK_THREAD_is_in_kernel
PK_THREAD_tidy
Any of the PK memory freeing functions ending in _f
The functions listed above can be called at any time by any thread during
chaining without being excluded.
This function can only be called when the modeller is started.