2014-07-02 22:47:10 +00:00
|
|
|
.TH 9PQUEUE 2
|
|
|
|
.SH NAME
|
|
|
|
Reqqueue,
|
|
|
|
reqqueuecreate,
|
|
|
|
reqqueuepush,
|
2014-07-02 23:01:20 +00:00
|
|
|
reqqueueflush \- deferred processing of 9P requests
|
2014-07-02 22:47:10 +00:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.ft L
|
|
|
|
.nf
|
|
|
|
#include <u.h>
|
|
|
|
#include <libc.h>
|
|
|
|
#include <fcall.h>
|
|
|
|
#include <thread.h>
|
|
|
|
#include <9p.h>
|
|
|
|
.fi
|
|
|
|
.PP
|
|
|
|
.ft L
|
|
|
|
.nf
|
|
|
|
.ta \w'\fLFile 'u
|
|
|
|
struct Reqqueue
|
|
|
|
{
|
|
|
|
\fI...\fP
|
|
|
|
};
|
|
|
|
.fi
|
|
|
|
.PP
|
|
|
|
.ft L
|
|
|
|
.nf
|
|
|
|
.ta \w'\fLReaddir* 'u +4n +4n
|
|
|
|
Reqqueue* reqqueuecreate(void);
|
|
|
|
void reqqueuepush(Reqqueue *q, Req *r, void (*f)(Req *));
|
|
|
|
void reqqueueflush(Reqqueue *q, Req *r);
|
2015-10-12 08:41:40 +00:00
|
|
|
void reqqueuefree(Reqqueue *q);
|
2014-07-02 22:47:10 +00:00
|
|
|
.fi
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.I Reqqueue
|
2014-07-02 23:01:20 +00:00
|
|
|
provides routines for deferred processing of 9p request in
|
2014-07-02 22:47:10 +00:00
|
|
|
multithreaded 9p servers.
|
|
|
|
.PP
|
|
|
|
The
|
|
|
|
.I reqqueuecreate
|
|
|
|
function spawns a process for handling requests returning
|
|
|
|
a pointer to the
|
|
|
|
.I Reqqueue
|
|
|
|
structure allocated.
|
|
|
|
.PP
|
|
|
|
To schedule a request to be processed on a queue,
|
|
|
|
.I reqqueuepush
|
|
|
|
is called with request
|
|
|
|
.I r
|
|
|
|
and its handler function
|
|
|
|
.IR f .
|
|
|
|
.PP
|
2014-07-02 23:01:20 +00:00
|
|
|
A previously submitted request can be flushed from a queue
|
2014-07-02 22:47:10 +00:00
|
|
|
by
|
|
|
|
.I reqqueueflush
|
2014-07-02 23:01:20 +00:00
|
|
|
which will remove the request immediately if processing has
|
2014-07-02 22:47:10 +00:00
|
|
|
not started. If processing has been started, the process
|
|
|
|
will be interrupted.
|
2015-10-12 08:41:40 +00:00
|
|
|
.PP
|
|
|
|
.I Reqqueuefree
|
|
|
|
frees a queue.
|
2022-04-19 20:21:37 +00:00
|
|
|
No new requests should be sent to the queue and it will be freed once all requests in it have been processed.
|
2014-07-02 22:47:10 +00:00
|
|
|
.SH SOURCE
|
|
|
|
.B /sys/src/lib9p/queue.c
|
|
|
|
.SH SEE ALSO
|
|
|
|
.IR 9p (2)
|