Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 5 20:14:54 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m963EsDg015423 for ; Sun, 5 Oct 2008 20:14:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m963KYZd009981 for ; Sun, 5 Oct 2008 20:20:34 -0700 Message-Id: <200810060320.m963KYZd009981@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Reg:Project 3 Date: Sun, 05 Oct 2008 20:20:34 -0700 From: Bill Cheng Someone wrote: > For a particular connection if I have one thread to Read and one thread > to write, now if the readThread is blocked on read call, and writeThread is > blocked on write call, would it be valid to read & write on socket > simultaneaously.First of all is that possible on using blocking system calls > read and write with Threads.Please clarify I've talked about this in class. I have heard that you cannot read and write on the same socket simultaneously. But I never understood why this would be true since a socket is "full-duplex", i.e., you can read and write simultaneously. If someone know this for sure (meaning you have a good source of information, not something from the Internet), please let me know! If you are not sure, you should implement it so that you assume the worst, i.e., you should assume that you cannot read and write the same socket at the same time. If you do it this way, your code will always work! -- Bill Cheng // bill.cheng@usc.edu