Re: Use of asynchronous receive at kernel level
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=JiCGlOUVc2BY4VCiRvHpe9KZ49FcSRAUp450z4FwGRo=; b=vl1Y+Rj5Ow6hMPMc1eN1CXNJLMjjdy8L7ayZJZt5jNBJWgdyyzX4dn57opTjmU/J5aOtQXixoRvcKs24EtUn5ogmuE2pF4Dw16U/haoskmIsEPYPfZLucQCdWX1Xq7r6RX/yLX4FxjDYcF9M3BoHORG7OBvsxv8O51RrRaIOQxw= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=eNJaodbk782DolY8m+t20ctxl9K1jUnZWflsHfeHKBzu6s/SoOIQkBPKVc6CWFNlrp4FIBbE9MPEzYYhZr3pc8H+wWO0sNcA2XhY7R3HN6SDNP0N1tUiNRDBmCDMq8m80COFg6qVh11vqLIeQXVorVWIty19pWRHVDl8pzTzYjk= typedef void (*sock_upcall)( socket_t so, void*cookie, int waitf); 1- when "socket_accept()" 2 - how http://developer.apple.com/documentation/Darwin/Conceptual/NKEConceptual/Soc... Cheers! On Fri, May 16, 2008 at 7:31 AM, Rick Macklem <rmacklem@uoguelph.ca> wrote:
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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/openspecies%40gmail.com
This email sent to openspecies@gmail.com
-- -mmw _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
mm w