/freebsd/contrib/ntp/libntp/lib/isc/ |
H A D | task.c | 25 * XXXRTH Need to document the states a task can be in, and the rules 38 #include <isc/task.h> 51 * when built without threads we share a single global task manager and use 52 * an integrated event loop for socket, timer, and other generic task events. 54 * we don't use either of them: an application can have multiple task managers 70 #define XTRACE(m) fprintf(stderr, "task %p thread %lu: %s\n", \ 71 task, isc_thread_self(), (m)) 72 #define XTTRACE(t, m) fprintf(stderr, "task %p thread %lu: %s\n", \ 108 /* Locked by task lock. */ 118 /* Locked by task manager lock. */ [all …]
|
/freebsd/contrib/ntp/libntp/lib/isc/include/isc/ |
H A D | task.h | 27 /*! \file isc/task.h 28 * \brief The task system provides a lightweight execution context, which is 31 * When a task's event queue is non-empty, the 32 * task is runnable. A small work crew of threads, typically one per CPU, 56 * Events which have been queued for a task but not delivered may be removed 57 * from the task's event queue by purging or unsending. 109 /*% Task and task manager methods */ 124 void (*send)(isc_task_t *task, isc_event_t **eventp); 126 unsigned int (*unsend)(isc_task_t *task, void *sender, isc_eventtype_t type, 128 isc_result_t (*onshutdown)(isc_task_t *task, isc_taskaction_t action, [all …]
|
H A D | socket.h | 29 * sources in the task system. 32 * event queue of the task which requested the I/O. 37 * Clients of this module must not be holding a socket's task's lock when 272 void *cbarg, isc_task_t *task, 283 isc_task_t *task, isc_taskaction_t action, 287 isc_task_t *task, isc_taskaction_t action, 290 unsigned int minimum, isc_task_t *task, 292 void (*cancel)(isc_socket_t *sock, isc_task_t *task, 358 isc_task_t *task, 462 isc_socket_cancel(isc_socket_t *sock, isc_task_t *task, [all …]
|
/freebsd/sys/compat/linuxkpi/common/src/ |
H A D | linux_kthread.c | 44 linux_kthread_should_stop_task(struct task_struct *task) in linux_kthread_should_stop_task() argument 47 return (atomic_read(&task->kthread_flags) & KTHREAD_SHOULD_STOP_MASK); in linux_kthread_should_stop_task() 58 linux_kthread_stop(struct task_struct *task) in linux_kthread_stop() argument 63 * Assume task is still alive else caller should not call in linux_kthread_stop() 66 atomic_or(KTHREAD_SHOULD_STOP_MASK, &task->kthread_flags); in linux_kthread_stop() 67 kthread_unpark(task); in linux_kthread_stop() 68 wake_up_process(task); in linux_kthread_stop() 69 wait_for_completion(&task->exited); in linux_kthread_stop() 72 * Get return code and free task structure: in linux_kthread_stop() 74 retval = task->task_ret; in linux_kthread_stop() [all …]
|
H A D | linux_schedule.c | 59 linux_add_to_sleepqueue(void *wchan, struct task_struct *task, in linux_add_to_sleepqueue() argument 91 linux_schedule_save_interrupt_value(task, ret); in linux_add_to_sleepqueue() 117 wake_up_task(struct task_struct *task, unsigned int state) in wake_up_task() argument 122 sleepq_lock(task); in wake_up_task() 123 if ((atomic_read(&task->state) & state) != 0) { in wake_up_task() 124 set_task_state(task, TASK_WAKING); in wake_up_task() 125 sleepq_signal(task, SLEEPQ_SLEEP, 0, 0); in wake_up_task() 128 sleepq_release(task); in wake_up_task() 133 linux_signal_pending(struct task_struct *task) in linux_signal_pending() argument 138 td = task->task_thread; in linux_signal_pending() [all …]
|
/freebsd/share/man/man9/ |
H A D | taskqueue.9 | 34 .Nd asynchronous task execution 46 struct task { 47 STAILQ_ENTRY(task) ta_link; /* link for queue */ 49 u_short ta_priority; /* priority of task in queue */ 50 task_fn_t ta_func; /* task handler */ 84 .Fn taskqueue_enqueue "struct taskqueue *queue" "struct task *task" 86 .Fn taskqueue_enqueue_flags "struct taskqueue *queue" "struct task *task" "int flags" 92 .Fn taskqueue_cancel "struct taskqueue *queue" "struct task *task" "u_int *pendp" 96 .Fn taskqueue_drain "struct taskqueue *queue" "struct task *task" 111 .Fn TASK_INIT "struct task *task" "int priority" "task_fn_t func" "void *context" [all …]
|
/freebsd/sys/compat/linuxkpi/common/include/linux/ |
H A D | sched.h | 101 #define task_pid_group_leader(task) (task)->task_thread->td_proc->p_pid argument 102 #define task_pid(task) ((task)->pid) argument 103 #define task_pid_nr(task) ((task)->pid) argument 104 #define task_pid_vnr(task) ((task)->pid) argument 108 #define task_euid(task) ((task)->task_thread->td_ucred->cr_uid) argument 110 #define get_task_state(task) atomic_read(&(task)->state) argument 111 #define set_task_state(task, x) atomic_set(&(task)->state, (x)) argument 112 #define __set_task_state(task, x) ((task)->state.counter = (x)) argument 117 get_task_struct(struct task_struct *task) in get_task_struct() argument 119 atomic_inc(&task->usage); in get_task_struct() [all …]
|
H A D | kthread.h | 48 struct task_struct *task; member 54 struct task task; member 82 #define kthread_stop(task) linux_kthread_stop(task) argument 84 #define kthread_should_stop_task(task) linux_kthread_should_stop_task(task) argument 85 #define kthread_park(task) linux_kthread_park(task) argument 88 #define kthread_unpark(task) linux_kthread_unpark(task) argument 101 struct task __task; \ 126 TASK_INIT(&work->task, 0, lkpi_kthread_work_fn, work); in kthread_init_work() 134 error = taskqueue_enqueue_flags(worker->tq, &work->task, in kthread_queue_work() 147 taskqueue_cancel(work->tq, &work->task, &pending) != 0) in kthread_cancel_work_sync() [all …]
|
/freebsd/contrib/llvm-project/openmp/runtime/src/ |
H A D | kmp_tasking.cpp | 47 // __kmp_trace_task_stack: print the tied tasks from the task stack in order 51 // thread_data: thread data for task team thread containing stack 102 // __kmp_init_task_stack: initialize the task stack for the first time 107 // thread_data: thread data for task team thread containing stack 125 // __kmp_free_task_stack: free the task stack when thread_data is destroyed. 152 // __kmp_push_task_stack: Push the tied task onto the task stack. 157 // tied_task: the task to push on the stack 173 ("__kmp_push_task_stack(enter): GTID: %d; THREAD: %p; TASK: %p\n", in __kmp_push_task_stack() 183 // Find beginning of this task block in __kmp_push_task_stack() 202 ("__kmp_push_task_stack(): GTID: %d; TASK: %p; Alloc new block: %p\n", in __kmp_push_task_stack() [all …]
|
H A D | kmp_taskdeps.h | 94 static inline void __kmp_release_deps(kmp_int32 gtid, kmp_taskdata_t *task) { in __kmp_release_deps() argument 97 if (task->is_taskgraph && !(__kmp_tdg_is_recording(task->tdg->tdg_status))) { in __kmp_release_deps() 98 kmp_node_info_t *TaskInfo = &(task->tdg->record_map[task->td_task_id]); in __kmp_release_deps() 102 kmp_node_info_t *successor = &(task->tdg->record_map[successorNumber]); in __kmp_release_deps() 104 if (successor->task != nullptr && npredecessors == 0) { in __kmp_release_deps() 105 __kmp_omp_task(gtid, successor->task, false); in __kmp_release_deps() 113 kmp_depnode_t *node = task->td_depnode; in __kmp_release_deps() 125 if (task->td_dephash) { in __kmp_release_deps() 127 40, ("__kmp_release_deps: T#%d freeing dependencies hash of task %p.\n", in __kmp_release_deps() 128 gtid, task)); in __kmp_release_deps() [all …]
|
H A D | kmp_taskdeps.cpp | 38 node->dn.task = NULL; // will point to the right task in __kmp_init_node() 49 __itt_sync_create(node, "OMP task dep node", NULL, 0); in __kmp_init_node() 182 if (!h->last_all) // no predecessor task with omp_all_memory dependence in __kmp_dephash_find() 222 kmp_taskdata_t *task_source = KMP_TASK_TO_TASKDATA(source->dn.task); in __kmp_track_dependence() 224 if (source->dn.task && sink_task) { in __kmp_track_dependence() 260 kmp_taskdata_t *task_source = KMP_TASK_TO_TASKDATA(source->dn.task); in __kmp_track_dependence() 261 // do not use sink->dn.task as that is only filled after the dependences in __kmp_track_dependence() 270 /* OMPT tracks dependences between task (a=source, b=sink) in which in __kmp_track_dependence() 271 task a blocks the execution of b through the ompt_new_dependence_callback in __kmp_track_dependence() 274 kmp_taskdata_t *task_source = KMP_TASK_TO_TASKDATA(source->dn.task); in __kmp_track_dependence() [all …]
|
H A D | kmp_cancel.cpp | 20 @param loc_ref location of the original task directive 78 // cancellation requests for a task group in __kmpc_cancel() 81 kmp_taskdata_t *task; in __kmpc_cancel() local 84 task = this_thr->th.th_current_task; in __kmpc_cancel() 85 KMP_DEBUG_ASSERT(task); in __kmpc_cancel() 87 taskgroup = task->td_taskgroup; in __kmpc_cancel() 126 @param loc_ref location of the original task directive 191 // cancellation requests for a task group in __kmpc_cancellationpoint() 194 kmp_taskdata_t *task; in __kmpc_cancellationpoint() local 197 task = this_thr->th.th_current_task; in __kmpc_cancellationpoint() [all …]
|
H A D | kmp_omp.h | 103 offset_and_size_t th_task_team; // task team struct 104 offset_and_size_t th_current_task; // innermost task being executed 106 th_task_state; // alternating 0/1 for task team identification 134 offset_and_size_t t_task_team; // task team structure 135 offset_and_size_t t_implicit_task; // taskdata for the thread's implicit task 186 offset_and_size_t td_task_id; // task id 187 offset_and_size_t td_flags; // task flags 188 offset_and_size_t td_team; // team for this task 189 offset_and_size_t td_parent; // parent task 190 offset_and_size_t td_level; // task testing level [all …]
|
/freebsd/sys/dev/isci/scil/ |
H A D | scic_task_request.h | 62 * task management requests. 76 * based task management request object. 78 * @return Return the size of the SCIC task request object. 86 * task management requests, regardless of protocol. Memory 87 * initialization and functionality common to all task request types 91 * the user task request object and the core task request object. 94 * for which to build the task managmement request. 96 * object for which to build the task management request. 99 * memory when the task is allocated internally during the 108 * task request to be utilized during construction. This task [all …]
|
H A D | scif_task_request.h | 61 * can be referenced and used by the SCI user for the SCI task 75 * based task request object (includes core & framework object size). 77 * @return Retrun the size of the SCI task request object. 84 * @brief This method is called by the SCIF user to construct a task 85 * management request. This method will construct a SCIC task request 89 * the user task request object and the framework task request object. 94 * remote device with which this task request is to be associated. 102 * task request to be utilized during task construction. This task 104 * task request object. 106 * to be utilized in the construction of the framework task request. [all …]
|
H A D | scif_sas_task_request_state_handlers.c | 72 * when the user attempts to start the supplied task request. 74 * @param[in] task_request This parameter specifies the task request object 77 * @return This method returns a value indicating if the task request was 80 * of the task request. 96 * when the user attempts to abort the supplied task request. 98 * @param[in] task_request This parameter specifies the task request object 101 * @return This method returns a value indicating if the task request was 104 * of the task request. 124 * when the user attempts to abort the supplied task request. 126 * @param[in] task_request This parameter specifies the task request object [all …]
|
/freebsd/sys/contrib/openzfs/module/os/freebsd/spl/ |
H A D | spl_taskq.c | 50 * Global system-wide dynamic task queue available for all consumers. This 346 taskq_free(taskq_ent_t *task) in taskq_free() argument 348 taskq_remove(task); in taskq_free() 349 if (refcount_release(&task->tqent_rc)) in taskq_free() 350 uma_zfree(taskq_zone, task); in taskq_free() 377 * Tasks normally free themselves when run, but here the task in taskq_cancel_id() 390 taskq_ent_t *task = arg; in taskq_run() local 394 task->tqent_func(task->tqent_arg); in taskq_run() 395 taskq_free(task); in taskq_run() 402 taskq_ent_t *task; in taskq_dispatch_delay() local [all …]
|
/freebsd/sys/kern/ |
H A D | subr_taskqueue.c | 49 static MALLOC_DEFINE(M_TASKQUEUE, "taskqueue", "Task Queues"); 57 struct task *tb_running; 64 STAILQ_HEAD(, task) tq_queue; 66 struct task *tq_hint; 127 task_get_busy(struct taskqueue *queue, struct task *task) in task_get_busy() argument 133 if (tb->tb_running == task) in task_get_busy() 231 taskqueue_enqueue_locked(struct taskqueue *queue, struct task *task, int flags) in taskqueue_enqueue_locked() argument 233 struct task *ins; in taskqueue_enqueue_locked() 234 struct task *prev; in taskqueue_enqueue_locked() 237 KASSERT(task->ta_func != NULL, ("enqueueing task with NULL func")); in taskqueue_enqueue_locked() [all …]
|
/freebsd/sys/cddl/compat/opensolaris/kern/ |
H A D | opensolaris_taskq.c | 114 taskq_ent_t *task = arg; in taskq_run() local 116 task->tqent_func(task->tqent_arg); in taskq_run() 118 uma_zfree(taskq_zone, task); in taskq_run() 124 taskq_ent_t *task; in taskq_dispatch() local 132 * If TQ_FRONT is given, we want higher priority for this task, so it in taskq_dispatch() 137 task = uma_zalloc(taskq_zone, mflag); in taskq_dispatch() 138 if (task == NULL) in taskq_dispatch() 141 task->tqent_func = func; in taskq_dispatch() 142 task->tqent_arg = arg; in taskq_dispatch() 144 TASK_INIT(&task->tqent_task, prio, taskq_run, task); in taskq_dispatch() [all …]
|
/freebsd/contrib/llvm-project/llvm/include/llvm/Support/ |
H A D | ThreadPool.h | 44 /// them. Note that this may result in a deadlock in cases such as when a task 46 /// available threads are used up by tasks waiting for a task that has no thread 50 /// The actual method to enqueue a task to be defined by the concrete 52 virtual void asyncEnqueue(std::function<void()> Task, 62 /// Calling wait() from a task would deadlock waiting for itself. 66 /// It is possible to wait even inside a task, but waiting (directly or 67 /// indirectly) on itself will deadlock. If called from a task running on a 75 /// Asynchronous submission of a task to the pool. The returned future can be 76 /// used to wait for the task to finish and is *non-blocking* on destruction. 79 auto Task = in async() local [all …]
|
/freebsd/sys/dev/isci/ |
H A D | isci_task_request.c | 40 * @brief This user callback will inform the user that a task management 44 * which the task management request is completing. 46 * which this task management request is completing. 47 * @param[in] task_request This parameter specifies the task management 68 * task management request. 72 * refer to the transport task information unit description 76 * task request object. It is a cookie that allows the user to 94 * @brief This method returns the task management function to be utilized 95 * for this task request. 99 * refer to the transport task information unit description [all …]
|
/freebsd/sys/sys/ |
H A D | taskqueue.h | 78 int taskqueue_enqueue(struct taskqueue *queue, struct task *task); 79 int taskqueue_enqueue_flags(struct taskqueue *queue, struct task *task, 86 int taskqueue_poll_is_busy(struct taskqueue *queue, struct task *task); 87 int taskqueue_cancel(struct taskqueue *queue, struct task *task, 91 void taskqueue_drain(struct taskqueue *queue, struct task *task); 117 * Initialise a task structure. 119 #define TASK_INIT_FLAGS(task, priority, func, context, flags) do { \ argument 120 (task)->ta_pending = 0; \ 121 (task)->ta_priority = (priority); \ 122 (task)->ta_flags = (flags); \ [all …]
|
/freebsd/contrib/llvm-project/llvm/include/llvm/ExecutionEngine/Orc/ |
H A D | TaskDispatch.h | 1 //===--------- TaskDispatch.h - ORC task dispatch utils ---------*- C++ -*-===// 9 // Task and TaskDispatch classes. 34 /// Represents an abstract task for ORC to run. 35 class Task : public RTTIExtends<Task, RTTIRoot> { 39 virtual ~Task() = default; 41 /// Description of the task to be performed. Used for logging. 44 /// Run the task. 52 class GenericNamedTask : public RTTIExtends<GenericNamedTask, Task> { 58 /// Generic task implementation. 77 /// Create a generic named task from a std::string description. [all …]
|
/freebsd/sys/contrib/dev/mediatek/mt76/ |
H A D | util.h | 38 struct task_struct *task; member 80 w->task = kthread_run(__mt76_worker_fn, w, in mt76_worker_setup() 83 if (!IS_ERR(w->task)) in mt76_worker_setup() 86 rc = PTR_ERR(w->task); in mt76_worker_setup() 87 w->task = NULL; in mt76_worker_setup() 95 if (w->task == NULL) in mt76_worker_schedule() 100 wake_up_process(w->task); in mt76_worker_schedule() 107 if (w->task == NULL) in mt76_worker_enable() 110 kthread_unpark(w->task); in mt76_worker_enable() 118 if (w->task == NULL) in mt76_worker_disable() [all …]
|
/freebsd/contrib/llvm-project/lldb/source/Plugins/Trace/intel-pt/ |
H A D | TaskTimer.h | 26 /// Execute the given \p task and record its duration. 29 /// The name used to identify this task for reporting. 31 /// \param[in] task 32 /// The task function. 35 /// The return value of the task. 36 template <typename C> auto TimeTask(llvm::StringRef name, C task) { in TimeTask() argument 38 auto result = task(); in TimeTask() 46 /// Executive the given \p callback on each recorded task. 49 /// The first parameter of the callback is the name of the recorded task, 50 /// and the second parameter is the duration of that task.
|