]> git.lizzy.rs Git - plan9front.git/blob - sys/man/2/9pqueue
merge
[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 .fi
33 .SH DESCRIPTION
34 .I Reqqueue
35 provides routines for deferred processing of 9p request in
36 multithreaded 9p servers.
37 .PP
38 The
39 .I reqqueuecreate
40 function spawns a process for handling requests returning
41 a pointer to the
42 .I Reqqueue
43 structure allocated.
44 .PP
45 To schedule a request to be processed on a queue,
46 .I reqqueuepush
47 is called with request
48 .I r
49 and its handler function
50 .IR f .
51 .PP
52 A previously submitted request can be flushed from a queue
53 by
54 .I reqqueueflush
55 which will remove the request immediately if processing has
56 not started. If processing has been started, the process
57 will be interrupted.
58 .SH SOURCE
59 .B /sys/src/lib9p/queue.c
60 .SH SEE ALSO
61 .IR 9p (2)