[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] Starting over?



Hi,

On 03/06/15 21:32, Alex Bligh wrote:
[...]
> I agree using the stack for state (as you put it) is not nice. But
> if the idea is merely to handle simultaneous requests, threading
> might be an alternative route. IE have one thread handling the
> socket, and a bunch of workers handling the requests.
> 
> This would be trivial in golang.

We've got an NBD server ("flexnbd") that does
thread-per-client-connection in a fairly nasty way. I can't say I can
recommend it particularly, but that might just be because we didn't do
it very well.  Our use case generally only has a single client connected
to each server process at any one time anyhow, so it's all a bit
gratuitous.

I've got half a golang NBD server hanging around *somewhere*, I think I
got as far as implementing the newstyle negotiation.  Happy to dig that
out if it's likely to be of interest to anyone. "Write an NBD server in
it" has become my get-to-know-a-language project :D.

/Nick



Reply to: