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,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!news2.euro.net!newsfeed.freenet.de!news.newsland.it!not-for-mail From: nospam@bba.com (Lisa Ansellotti) Newsgroups: comp.lang.ada Subject: curses and multithreading Date: Tue, 04 Aug 2009 22:43:53 +0200 Organization: http://www.newsland.it/ Message-ID: NNTP-Posting-Host: host24-3-static.30-87-b.business.telecomitalia.it Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.newsland.it 1249418633 912 212.239.22.167 (4 Aug 2009 20:43:53 GMT) X-Complaints-To: abuse@newsland.it NNTP-Posting-Date: Tue, 4 Aug 2009 20:43:53 +0000 (UTC) X-HTTP-Posting-Host: host24-3-static.30-87-b.business.telecomitalia.it User-Agent: www.newsland.it X-NL-St: Trp.09Aug04@st.mynl.it X-NL-Posting-Ip: 87.30.3.24 X-NL-Posting-Site: www.newsland.it Xref: g2news2.google.com comp.lang.ada:7583 Date: 2009-08-04T22:43:53+02:00 List-Id: hi, i'm a newbie in ada. i'm using curses, and multithreading. Linux and gnat. i'm making an application that uses windows (not MS windows). three windows, one for my inputs, one for the output of the commands (the input and the output are in the main thread. input is readed, a parses get the string and write the output on the output window), and a second thread uses the third window. this thread is independent, it reads the db and display on its window the results, and uses only its window. 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; ---------------------------------------------- -- Main ---------------------------------------------- begin . . . . dbCheck.StartRun while XXXXXXX loop Terminal_Interface.Curses.Get (win=>winInput,str=>strInput,len=>10,line=>0,column=>0); RunCommand(strInput); end loop; . . . . . . . -- questo articolo e` stato inviato via web dal servizio gratuito http://www.newsland.it/news segnala gli abusi ad abuse@newsland.it