On Mon, Mar 18, 2002, Malcolm Kavalsky wrote about "Re: pthreads question":
> I asked one of the top Unix hackers that I know, and he said:
> 
> "I would guess that if you do large af_unix transfers that are page
> aligned then the system doesn't have to actually copy the data rather it
> can share the page and do a copy on write. This preserves the socket
> semantics and can be faster than memcpy. This was done many years ago in
> Solaris."
> 
> I wonder if digging deep enough in the kernel sources, will reveal this ... 

You can try to check if this is the case, by following each send or memcpy
by a memset() of the buffer. If the memcpy method suddenly becomes quicker,
this explanation might be true.
Strange though - how come malloc() returns page-aligned buffers? Does the
Linux code really checks for this rare and rather esoteric case (if you
write to the buffer after sending it, and the kernel can't know you're
writing whole pages, it will have to do a copy-on- write and do the copy
anyway).

-- 
Nadav Har'El                        |        Monday, Mar 18 2002, 5 Nisan 5762
[EMAIL PROTECTED]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |An error? Impossible! My modem is error
http://nadav.harel.org.il           |correcting.

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to