From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,4b6fdc222af60b8b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news1.google.com!news.glorb.com!gegeweb.org!fdn.fr!freenix!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: curses and multithreading Date: Wed, 05 Aug 2009 10:17:34 +0200 Organization: Adalog Message-ID: <57fb5h.i45.ln@hunter.axlog.fr> References: NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1249452095 13902 195.25.228.57 (5 Aug 2009 06:01:35 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Wed, 5 Aug 2009 06:01:35 +0000 (UTC) User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) In-Reply-To: Xref: g2news2.google.com comp.lang.ada:7590 Date: 2009-08-05T10:17:34+02:00 List-Id: Lisa Ansellotti a �crit : [...] > the problem is this: i need that the secondary thread use the window to > ouput data, and the main thread continuosly get input, elaborate the input > and give the output on its windows (not in the second thread's window). > > but if i try to do this, the secondary thread stops the input. > in the main thread i do a "get" for input a string, when the secondary > thread do an output on ITS window, the input in the input window is > blocked. > > how can i do to make the two threads independently use input/output, > without one block the other thread's i/o? > > > this is a part of the source. > > > task DbCheck is > entry StartRun; > end DbCheck; > > > task body DbCheck is > begin > accept StartRun do > While ContinueRunning=true loop > delay 20.0; > WriteDbMessages; > end loop; > end Ciclo; > end DbCheck; Here, your loop is *inside* the rendezvous. It means that the caller (main) will not proceed until the loop is over. You probably meant: task body DbCheck is begin accept StartRun; -- Main returns here While ContinueRunning=true loop delay 20.0; WriteDbMessages; end loop; > end DbCheck; Note that: 1) your code has this problem, but it is not exactly what you describe 2) your code has a syntax error ("end Ciclo" instead of "end StartRun"). Please always provide the *exact code* that shows the problem, to allow us to be maximally helpful. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr