Commit 86145bbf authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Add Server.singleReader option which uses a single read loop.

parent 86baacc6
......@@ -43,8 +43,9 @@ type Server struct {
outstandingReadBufs int
kernelSettings InitIn
canSplice bool
loops sync.WaitGroup
singleReader bool
canSplice bool
loops sync.WaitGroup
}
func (ms *Server) SetDebug(dbg bool) {
......@@ -239,7 +240,7 @@ func (ms *Server) readRequest(exitIdle bool) (req *request, code Status) {
dest = nil
}
ms.reqReaders--
if ms.reqReaders <= 0 {
if !ms.singleReader && ms.reqReaders <= 0 {
ms.loops.Add(1)
go ms.loop(true)
}
......@@ -311,7 +312,11 @@ exit:
break exit
}
ms.handleRequest(req)
if ms.singleReader {
go ms.handleRequest(req)
} else {
ms.handleRequest(req)
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment