how pipeline works

"Jerry G. Chiuan" <[email protected]>
Newsgroups gmane.comp.lib.libwww
Message-ID <1de801c373d6$0c8208f0$25a8a8a8@piglet>
Hi All,
here I have a basic question regarding pipeline:

we all know that by having persistent connection client doesn't need to open
a new TCP connection for sending following requests
Moreover, we can adopt pipeline to send out next request "before" client
receives the response for current request

- By using pipeline, does client need only one TCP connection? ( all
requests go through the same connection )
- If yes, how does it guatantee the sequence of consecutive responses? e.g.
server takes longer time to deal with 1st request, but shorter time for 2nd
request. The server would hold 2nd response until 1st response is generated
then send them both sequentially back to client, or the server just sends
back directly no matter which response is ready
- for doing that, we at least need 2 threads, one is for sending requests,
another is for receiving reponses, don't we?

Regds,
- Jerry
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.