GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  IV_TASK_REGISTER (3)

NAME

iv_task_register, iv_task_unregister, iv_task_registered - deal with ivykis tasks

CONTENTS

Synopsis
Description

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(const 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 happens, 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 registered 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)
Search for    or go to Top of page |  Section 3 |  Main Index


ivykis IV_TASK (3) 2010-08-15

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.