Return-Path: Delivered-To: apmail-mina-dev-archive@www.apache.org Received: (qmail 60383 invoked from network); 3 Aug 2007 16:40:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Aug 2007 16:40:55 -0000 Received: (qmail 38722 invoked by uid 500); 3 Aug 2007 16:40:53 -0000 Delivered-To: apmail-mina-dev-archive@mina.apache.org Received: (qmail 38694 invoked by uid 500); 3 Aug 2007 16:40:53 -0000 Mailing-List: contact dev-help@mina.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mina.apache.org Delivered-To: mailing list dev@mina.apache.org Received: (qmail 38684 invoked by uid 99); 3 Aug 2007 16:40:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Aug 2007 09:40:53 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Aug 2007 16:40:30 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1IH0CQ-0000pb-Fj for dev@mina.apache.org; Fri, 03 Aug 2007 09:40:26 -0700 Message-ID: <11986763.post@talk.nabble.com> Date: Fri, 3 Aug 2007 09:40:26 -0700 (PDT) From: Pradheep To: dev@mina.apache.org Subject: An issue with multiple threads..... - Reposted due to formatting issues MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: PRADHEEP.T@GMAIL.COM X-Virus-Checked: Checked by ClamAV on apache.org Hi, I'm facing an issue when the multiple threads are accessing the session (IOSession) concurrently.
ISSUE When the client is invoked with multiple threads, the client keeps sending the requests to but the packets never reach the server. at one point of time all the threads are waiting for the resposne ie the client is completely blocked. But when a new client connects to it, it works fine, but the previous client simply waits for response (the server prints each request it receives) Question Are there any such known issues on MINA or is it problem with the way the code operates (pseudo code is given below). -------------------------------------------------------------------------------------------------------------------------- void sendAndWaitForResponse() { synchronized(iosession) { Response responseMessage = new Respons(); iosession.write(message); // write the bytes in to session map.put(requestID,response) //store the response object in a MAP - with an id responseMessage.wait(); } } void responseReceived(Response receivedResposne) { Response lockedResponse = map.get(receivedResposne.getID()); lockedResponse.notify(); } -------------------------------------------------------------------------------------------------------------------------- Note - It is very much sure that ID generation produces unique key. Thanks in advance, Let me know if you need more information. regards, Pradheep. -- View this message in context: http://www.nabble.com/An-issue-with-multiple-threads.....---Reposted-due-to-formatting-issues-tf4213558s16868.html#a11986763 Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.