]> git.lizzy.rs Git - plan9front.git/blob - sys/man/2/9pqueue
/sys/man/*/*: fix perms (sorry)
[plan9front.git] / sys / man / 2 / 9pqueue
1 .TH 9PQUEUE 2
2 .SH NAME
3 Reqqueue,
4 reqqueuecreate,
5 reqqueuepush,
6 reqqueueflush \- deferred processing of 9P requests
7 .SH SYNOPSIS
8 .ft L
9 .nf
10 #include <u.h>
11 #include <libc.h>
12 #include <fcall.h>
13 #include <thread.h>
14 #include <9p.h>
15 .fi
16 .PP
17 .ft L
18 .nf
19 .ta \w'\fLFile 'u
20 struct Reqqueue
21 {
22         \fI...\fP
23 };
24 .fi
25 .PP
26 .ft L
27 .nf
28 .ta \w'\fLReaddir* 'u +4n +4n
29 Reqqueue*       reqqueuecreate(void);
30 void            reqqueuepush(Reqqueue *q, Req *r, void (*f)(Req *));
31 void            reqqueueflush(Reqqueue *q, Req *r);
32 void            reqqueuefree(Reqqueue *q);
33 .fi
34 .SH DESCRIPTION
35 .I Reqqueue
36 provides routines for deferred processing of 9p request in
37 multithreaded 9p servers.
38 .PP
39 The
40 .I reqqueuecreate
41 function spawns a process for handling requests returning
42 a pointer to the
43 .I Reqqueue
44 structure allocated.
45 .PP
46 To schedule a request to be processed on a queue,
47 .I reqqueuepush
48 is called with request
49 .I r
50 and its handler function
51 .IR f .
52 .PP
53 A previously submitted request can be flushed from a queue
54 by
55 .I reqqueueflush
56 which will remove the request immediately if processing has
57 not started. If processing has been started, the process
58 will be interrupted.
59 .PP
60 .I Reqqueuefree
61 frees a queue.
62 No new requests should be send to the queue and it will be freed once all requests in it have been processed.
63 .SH SOURCE
64 .B /sys/src/lib9p/queue.c
65 .SH SEE ALSO
66 .IR 9p (2)