TCP non-blocking multitreads priority pre-emption?
- From: Ray <alienatsf@xxxxxxxxx>
- Date: Fri, 28 Sep 2007 10:18:04 -0700
Hi,
I am designing an application with two threads running with different
priority. Each thread uses the same TCP address and port to send
information out (i know i can easily change to have different port,
but i just wanted to know what would happen if they use the same
port).
My question is what data would the TCP send buffer contains if one
thread is running non-blocking send operation while another thread
with higher priority happens to preempt the previous thread to another
non-blocking do send operation.
For example,
Thread A has 10000 bytes to send. It is supposed to put 10000 bytes to
the send buffer, but the window size is smaller than that, say it is
8192 bytes. So only 8192 bytes of 102400 bytes data is copied to the
send buffer and do the send operation for thread A.
While thread A is sending the 5000th bytes, thread B preempts it and
trys to send 4000 bytes of data. remember both thread A and thread B
are sharing the same connection with same address and port.
Would the send buffer look like 5000 bytes from A + 4000 bytes from B
+ 5000 bytes from A?
Remember both send operations are running on non-blocking mode. What
if both send operations are running on blocking mode?
Thanks
Ray
.
- Prev by Date: Re: netfilter & SIP
- Next by Date: TCP non-blocking multithreads preemption
- Previous by thread: netfilter & SIP
- Next by thread: TCP non-blocking multithreads preemption
- Index(es):
Relevant Pages
|