Process-in-Process
 All Functions Groups Pages
Functions
Suspending and Resuming BLT/ULP

Functions

int pip_suspend_and_enqueue (pip_task_queue_t *queue, pip_enqueue_callback_t callback, void *cbarg)
 suspend the curren task and enqueue it with lock More...
 
int pip_suspend_and_enqueue_nolock (pip_task_queue_t *queue, pip_enqueue_callback_t callback, void *cbarg)
 suspend the curren task and enqueue it without locking the queue More...
 
int pip_dequeue_and_resume (pip_task_queue_t *queue, pip_task_t *sched)
 dequeue a task and make it runnable More...
 
int pip_dequeue_and_resume_nolock (pip_task_queue_t *queue, pip_task_t *sched)
 dequeue a task and make it runnable More...
 
int pip_dequeue_and_resume_N (pip_task_queue_t *queue, pip_task_t *sched, int *np)
 dequeue multiple tasks and resume the execution of them More...
 
int pip_dequeue_and_resume_N_nolock (pip_task_queue_t *queue, pip_task_t *sched, int *np)
 dequeue tasks and resume the execution of them More...
 

Detailed Description

Suspending and resuming BLT/ULP

Description
Suspending and resuming BLT/ULP

Function Documentation

int pip_suspend_and_enqueue ( pip_task_queue_t *  queue,
pip_enqueue_callback_t  callback,
void *  cbarg 
)
Name
pip_suspend_and_enqueue
Synopsis
#include <pip/pip.h>
int pip_suspend_and_enqueue( pip_task_queue_t *queue, pip_enqueue_callback_t callback, void *cbarg );
Description
The queue is locked just before the calling task is enqueued and unlocked after the calling task is enqueued. After then the callback function is called.
As the result of this suspension, a context-switch takes place if there is at least one elgible-to-run task in the scheduling queue (this is hidden from users). If there is no other task to schedule then the kernel thread of the current task will be blocked.
Parameters
[in]queueA task queue
[in]callbackA callback function which is called immediately after the task is enqueued
[in]cbargAn argument given to the callback function
Returns
Return 0 on success. Return an error code on error.
Return values
EPERMPiP library is not initialized yet
EINVALqueue is NULL
See Also
pip_enqueue_and_suspend_nolock
pip_dequeue_and_resume
int pip_suspend_and_enqueue_nolock ( pip_task_queue_t *  queue,
pip_enqueue_callback_t  callback,
void *  cbarg 
)
Name
pip_suspend_and_enqueue_nolock
Synopsis
#include <pip/pip.h>
int pip_suspend_and_enqueue_nolock( pip_task_queue_t *queue, pip_enqueue_callback_t callback, void *cbarg );
Description
Unlike pip_suspend_and_enqueue, this function never locks the queue. It is the user's responsibility to lock the queue beofre calling this function and unlock the queue after calling this function. The callback function can be used for unlocking.
As the result of this suspension, a context-switch takes place if there is at least one elgible-to-run task in the scheduling queue (this is hidden from users). If there is no other task to schedule then the kernel thread of the current task will be blocked.
Parameters
[in]queueA task queue
[in]callbackA callback function which is called when enqueued
[in]cbargAn argument given to the callback function
Returns
Return 0 on success. Return an error code on error.
Return values
EPERMPiP library is not initialized yet
EINVALqueue is NULL
int pip_dequeue_and_resume ( pip_task_queue_t *  queue,
pip_task_t *  sched 
)
Name
pip_dequeue_and_resume
Description
The queue is locked and then unlocked when to dequeued a task.
Synopsis
#include <pip/pip.h>
int pip_dequeue_and_resume( pip_task_queue_t *queue, pip_task_t *sched );
Parameters
[in]queueA task queue
[in]schedA task to specify a scheduling domain
Returns
If succeedss, 0 is returned. Otherwise an error code is returned.
Return values
EPERMPiP library is not initialized yet
EINVALqueue is NULL
ENOENTqueue is empty.
int pip_dequeue_and_resume_nolock ( pip_task_queue_t *  queue,
pip_task_t *  sched 
)
Name
pip_dequeue_and_resume_nolock
Synopsis
#include <pip/pip.h>
int pip_dequeue_and_resume( pip_task_queue_t *queue, pip_task_t *sched );
Description
Task in the queue is dequeued and scheduled by the specified sched. If sched is NULL, then the task is enqueued into the scheduling queue of calling task.
It is the user's responsibility to lock the queue beofre calling this function and unlock the queue after calling this function.
Parameters
[in]queueA task queue
[in]schedA task to specify a scheduling domain
Returns
This function returns no error
Return values
EPERMPiP library is not initialized yet
EINVALqueue is NULL
ENOENTqueue is empty.
int pip_dequeue_and_resume_N ( pip_task_queue_t *  queue,
pip_task_t *  sched,
int *  np 
)
Name
pip_dequeue_and_resume_N
Synopsis
#include <pip/pip.h>
int pip_dequeue_and_resume_N( pip_task_queue_t *queue, pip_task_t *sched, int *np );
Description
The specified number of tasks are dequeued and scheduled by the specified sched. If sched is NULL, then the task is enqueued into the scheduling queue of calling task.
The queue is locked and unlocked when dequeued.
Parameters
[in]queueA task queue
[in]schedA task to specify a scheduling domain
[in,out]npA pointer to an interger which spcifies the number of tasks dequeued and actual number of tasks dequeued is returned. When PIP_TASK_ALL is specified, then all tasks in the queue will be resumed.
Returns
This function returns no error
Return values
EPERMPiP library is not initialized yet
EINVALqueue is NULL
EINVALthe specified number of tasks is invalid
ENOENTqueue is empty.

It is the user's responsibility to lock the queue beofre calling this function and unlock the queue after calling this function.

int pip_dequeue_and_resume_N_nolock ( pip_task_queue_t *  queue,
pip_task_t *  sched,
int *  np 
)
Name
pip_dequeue_and_resume_N_nolock
Synopsis
#include <pip/pip.h>
int pip_dequeue_and_resume_N_nolock( pip_task_queue_t *queue, pip_task_t *sched, int *np );
Description
The specified number of tasks are dequeued and scheduled by the specified sched. If sched is NULL, then the task is enqueued into the scheduling queue of calling task.
It is the user's responsibility to lock the queue beofre calling this function and unlock the queue after calling this function.
Parameters
[in]queueA task queue
[in]schedA task to specify a scheduling domain
[in,out]npA pointer to an interger which spcifies the number of tasks dequeued and actual number of tasks dequeued is returned. When PIP_TASK_ALL is specified, then all tasks in the queue will be resumed.
Returns
This function returns no error
Return values
EPERMPiP library is not initialized yet
EINVALqueue is NULL
EINVALthe specified number of tasks is invalid
ENOENTqueue is empty.