Unix and Linux Discussions Tagged with task |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
2,797 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
738 |
UNIX for Beginners Questions & Answers |
|
|
|
0 |
2,375 |
What is on Your Mind? |
|
|
|
36 |
124,897 |
IP Networking |
|
|
|
0 |
1,050 |
Software Releases - RSS News |
|
|
|
0 |
4,653 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
1,694 |
Software Releases - RSS News |
|
|
|
0 |
1,009 |
Software Releases - RSS News |
|
|
|
0 |
1,230 |
Software Releases - RSS News |
|
|
|
2 |
8,708 |
Programming |
|
|
|
4 |
5,413 |
Shell Programming and Scripting |
|
|
|
0 |
853 |
Software Releases - RSS News |
|
|
|
0 |
879 |
Software Releases - RSS News |
|
|
|
0 |
883 |
Software Releases - RSS News |
|
|
|
4 |
2,446 |
Shell Programming and Scripting |
|
|
|
0 |
820 |
Software Releases - RSS News |
|
|
|
0 |
799 |
Software Releases - RSS News |
|
|
|
0 |
841 |
Software Releases - RSS News |
|
|
|
0 |
793 |
Software Releases - RSS News |
|
|
|
0 |
717 |
Software Releases - RSS News |
|
|
|
0 |
1,089 |
UNIX and Linux RSS News |
|
|
|
0 |
4,530 |
OS X (Apple) |
|
|
|
0 |
742 |
Software Releases - RSS News |
|
|
|
0 |
1,002 |
Software Releases - RSS News |
|
|
|
0 |
859 |
Software Releases - RSS News |
|
|
|
0 |
876 |
Software Releases - RSS News |
|
|
|
0 |
1,079 |
Software Releases - RSS News |
|
|
|
0 |
839 |
Software Releases - RSS News |
|
|
|
0 |
949 |
Software Releases - RSS News |
|
|
|
0 |
936 |
Software Releases - RSS News |
|
|
|
0 |
1,026 |
Software Releases - RSS News |
|
|
|
1 |
2,243 |
Solaris |
|
|
|
4 |
2,665 |
Shell Programming and Scripting |
|
|
|
0 |
1,089 |
UNIX and Linux RSS News |
|
|
|
17 |
7,163 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
2,760 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
5,175 |
Shell Programming and Scripting |
|
|
|
3 |
7,802 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
5,679 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
2,176 |
UNIX for Advanced & Expert Users |
iv_task(3) ivykis programmer's manual iv_task(3)
NAME
iv_task_register, iv_task_unregister, iv_task_registered - deal with ivykis tasks
SYNOPSIS
#include <iv.h>
struct iv_task {
void *cookie;
void (*handler)(void *);
};
void IV_TASK_INIT(struct iv_task *task);
void iv_task_register(struct iv_task *task);
void iv_task_unregister(struct iv_task *task);
int iv_task_registered(struct iv_task *task);
DESCRIPTION
The functions iv_task_register and iv_task_unregister register, respectively unregister, a task with the current thread's ivykis event
loop. iv_task_registered on a task returns true if that task is currently registered with ivykis.
A task is like a timer, but with an immediate timeout. When a task is registered, unless it is unregistered again first, the callback
function specified by ->handler is guaranteed to be called once, in the thread that the task was registered in, some time after control
returns to the ivykis main loop but before ivykis will sleep for more events, with ->cookie as its first and sole argument. When this hap-
pens, the task is transparently unregistered.
Tasks are mainly used for scheduling code for execution where it is not appropriate to directly run that code in the calling context (for
example, because the current context might be run as a callback function where the caller expects certain conditions to remain invariant
after the callback completes).
The application is allowed to change the ->cookie and ->handler members at any time.
A given struct iv_task can only be registered in one thread at a time, and a task can only be unregistered in the thread that it was regis-
tered from.
There is no limit on the number of tasks registered at once.
See iv_examples(3) for programming examples.
SEE ALSO
ivykis(3), iv_examples(3)
ivykis 2010-08-15 iv_task(3)