Networking Forums

Networking Forums > Computer Networking > Linux Networking > TCP non-blocking multithreads preemption

Reply
Thread Tools Display Modes

TCP non-blocking multithreads preemption

 
 
Ray
Guest
Posts: n/a

 
      09-28-2007, 05:33 PM
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 do
another
non-blocking 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
8000 bytes. So only 8000 bytes of 10000 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 + 3000 bytes from B,
then after thread A is done sending 5000 bytes and thread B is done
sending 3000 bytes, the send buffer looks like 1000 bytes from B +
3000 bytes from A + 2000 bytes from A? or it has different scheme?


Remember both send operations are running on non-blocking mode. What
if both send operations are running on blocking mode?


Thanks
Ray

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
blocking ports Guy Cohen Windows Networking 6 10-17-2007 03:53 AM
BT blocking web serving? coyoteboyuk@hotmail.com Broadband 3 10-25-2006 10:39 PM
Blocking IM gerald Windows Networking 3 02-07-2006 05:32 PM
What is difference of SYNC, ASYNC, BLOCKING, NON-BLOCKING sockets? kevin Linux Networking 0 11-21-2005 09:56 AM
Blocking P2P Mike Linux Networking 2 05-22-2004 12:59 PM



1 2 3 4 5 6 7 8 9 10 11