38 # include <dsn/c/api_common.h> 117 extern DSN_API
const char* dsn_threadpool_code_to_string(dsn_threadpool_code_t pool_code);
118 extern DSN_API dsn_threadpool_code_t dsn_threadpool_code_from_string(
120 dsn_threadpool_code_t default_code
122 extern DSN_API
int dsn_threadpool_code_max();
123 extern DSN_API
int dsn_threadpool_get_current_tid();
128 dsn_task_type_t type,
130 dsn_threadpool_code_t pool
132 extern DSN_API
void dsn_task_code_query(
133 dsn_task_code_t code,
134 dsn_task_type_t *ptype,
135 dsn_task_priority_t *ppri,
136 dsn_threadpool_code_t *ppool
138 extern DSN_API
void dsn_task_code_set_threadpool(
139 dsn_task_code_t code,
140 dsn_threadpool_code_t pool
142 extern DSN_API
void dsn_task_code_set_priority(dsn_task_code_t code, dsn_task_priority_t pri);
143 extern DSN_API
const char* dsn_task_code_to_string(dsn_task_code_t code);
144 extern DSN_API dsn_task_code_t dsn_task_code_from_string(
const char* s, dsn_task_code_t default_code);
145 extern DSN_API
int dsn_task_code_max();
146 extern DSN_API
const char* dsn_task_type_to_string(dsn_task_type_t tt);
147 extern DSN_API
const char* dsn_task_priority_to_string(dsn_task_priority_t tt);
155 dsn_task_code_t code,
void(* dsn_task_cancelled_handler_t)(void *)
callback prototype for task cancellation (called on task-being-cancelled)
Definition: api_task.h:111
dsn_task_priority_t
task priority
Definition: api_task.h:90
DSN_API volatile int * dsn_task_queue_virtual_length_ptr(dsn_task_code_t code, int hash DEFAULT(0))
apps updates the value at dsn_task_queue_virtual_length_ptr(..) to control the length of a vitual que...
task handling rpc response or timeout
Definition: api_task.h:53
void(* dsn_task_handler_t)(void *)
callback prototype for TASK_TYPE_COMPUTE
Definition: api_task.h:64
DSN_API dsn_threadpool_code_t dsn_threadpool_code_register(const char *name)
define a new thread pool with a given name
void(* dsn_rpc_request_handler_t)(dsn_message_t, void *)
callback prototype for TASK_TYPE_RPC_REQUEST
Definition: api_task.h:69
callback for file read and write
Definition: api_task.h:55
void(* dsn_rpc_response_handler_t)(dsn_error_t, dsn_message_t, dsn_message_t, void *)
callback prototype for TASK_TYPE_RPC_RESPONSE
Definition: api_task.h:75
void(* dsn_aio_handler_t)(dsn_error_t, size_t, void *)
callback prototype for TASK_TYPE_AIO
Definition: api_task.h:83
task handling rpc request
Definition: api_task.h:52
async calls or timers
Definition: api_task.h:54
DSN_API dsn_task_code_t dsn_task_code_register(const char *name, dsn_task_type_t type, dsn_task_priority_t, dsn_threadpool_code_t pool)
register a new task code
above tasks are seperated into several continuation tasks by thread-synchronization operations...
Definition: api_task.h:56
dsn_task_type_t
task/event type definition
Definition: api_task.h:50