RE: Use of asynchronous receive at kernel level
RE: Use of asynchronous receive at kernel level
- Subject: RE: Use of asynchronous receive at kernel level
- From: Rick Macklem <email@hidden>
- Date: Fri, 16 May 2008 10:31:38 -0400 (EDT)
On Thu, 15 May 2008, Eddy Quicksall wrote:
But there is only one upcall function per socket and there does not seem to
be any way to tell what the upcall is for. Is there something I'm missing?
The upcall was added to 4.3BSD back in the late 80s (I had more hair then,
but never wore disco boots:-). It was specifically for the nfs server. The
upcall is called whenever data is added to the receive queue for the TCP
socket. If you want to read data off the socket, you have to do a
soreceive() etc. Take a look at the nfs server sources in xnu-1228 to see
how the nfsd uses it. (xnu-1228/bsd/nfs/nfs_socket.c)
I'm not sure about xnu-1228, but in the bad old days the upcall function
couldn't tsleep(), so it basically would try and build up an RPC request
without blocking. If it had to block or once all of an RPC request was
received, it would wake up an nfsd thread to do the work.
And, yes, you can only have one upcall function associated with a TCP
socket, so you'll have to do whatever you want to do in that function, or
wake up other threads in the kernel to do the work.
Good luck with it, rick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden