efficient rpc io using vstr

Martin Pool mbp at sourcefrog.net
Tue Jan 20 05:03:10 GMT 2004


On 19 Jan 2004, "Stefan (metze) Metzmacher" <metze at samba.org> wrote:
> Martin Pool wrote:
> 
> >Here's an sketch of the kind of packet buffering using vstr that I
> >mentioned to tridge yesterday.  More discussion is in the comments.
> >
> >A sample input file is here
> >
> >  http://sourcefrog.net/projects/vstr-readpacket/
> >
> >I haven't benchmarked it other than running it under strace.
> 
> sounds good! This is what I disired in this mail point 1.2)
> I have some more ideas in mind which I need to put into code or a
> description...:
> 
> ...this hopefully let me abstract the server code a lot more,
> here some goals I have in mind:
> 
> 1.)	have a full async protocol stacking
> 1.1)	that means we have a 'service_context' for each listen socket
> 	and attach a 'protocol_ops' struct to it which known the
> 	first protocol on top of tcp.
> 1.2)	for each connection to a 'service' we got an
> 	'connection_context' which holds a read and write buffer for
> 	the connection socket(s)(we'll handle the read and write fd's
> 	seperate because this will us easy allow us to communicate over
> 	the stdin and stdout fd's).
> 1.3)	each subprotocol send's its data directly (this is non-blocking)
> 	to it's parent protocol, till it's in the connection_context's
> 	write buffer.
> 1.4)	the connection_context's write fd event's write_handler will
> 	then send the data to the socket.

Yes, my impression is that vstr will let you build up these buffers
without excessive copying, and without too much fear of losing data.
Everything could be async and you would just readv/writev the buffers
when the fd was ready.

-- 
Martin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/samba-technical/attachments/20040120/6375b454/attachment.bin


More information about the samba-technical mailing list