thread0 usage in syncache_socket()
John Baldwin
jhb at freebsd.org
Fri Apr 27 13:40:24 UTC 2012
On Friday, April 27, 2012 3:56:06 am Sebastian Huber wrote:
> Hi,
>
> in syncache_socket() in tcp_syncache.c the global variable thread0 is used to
> do a in6_pcbconnect() with the ucread of thread0. Why is the thread0 used here
> and not the one of the current thread?
The current thread is generally not all that interesting in this case. Note that
this is used for building a socket that will be returned by accept(), not due to
a call to connect(), so the only credential establishing this connection would
be the user on the remote machine that opened the connection. The current thread
for this call is typically an interrupt thread of some sort, but it can also be
a netisr thread, or a device driver taskqueue thread, etc. thread0 gives a stable
credential to use for creating accepted connections.
--
John Baldwin
More information about the freebsd-hackers
mailing list