void (*destroyfid)(Fid *fid);
void (*destroyreq)(Req *r);
+ void (*start)(Srv *s);
void (*end)(Srv *s);
void* aux;
is single-threaded.
If it is expected that some requests might
block, arranging for alternate processes
-to handle them is suggested.
+to handle them is suggested (see
+.IR 9pqueue (2)).
.PP
.I Srvrelease
-detaches the calling process from the server loop and
-if neccesary spawns a new process to handle 9p requests.
-When released, the process is free to do blocking work
-or even exit because it now running in parallel to the
-server loop.
+temporarily releases the calling process from the server
+loop and if neccesary spawns a new process to handle 9p
+requests. When released, the process can do blocking work
+that would otherwise halt processing of 9p requests.
.I Srvacquire
-joins the calling (released) process with the server loop.
+rejoins the calling process with the server loop after
+a srvrelease.
.PP
The constraints on the service functions are as follows.
These constraints are checked while the server executes.
.PP
.IR Destroyfid ,
.IR destroyreq ,
+.IR start ,
and
.I end
are auxiliary functions, not called in direct response to 9P requests.
.IB r -> aux
pointer.
.TP
+.I Start
+This gets called (from the forked service process)
+prior entering the 9P service loop.
+.TP
.I End
Once the 9P service loop has finished
(end of file been reached on the service pipe
and
.B /sys/src/lib9p/ramfs.c
are good examples of simple single-threaded file servers.
-.IR Webfs (4)
-and
-.I sshnet
-(see
-.IR ssh (1))
-are good examples of multithreaded file servers.
.PP
In general, the
.B File
.SH SEE ALSO
.IR 9pfid (2),
.IR 9pfile (2),
+.IR 9pqueue (2),
.IR srv (3),
.IR shr (3),
.IR intro (5)