comp.lang.ada
 help / color / mirror / Atom feed
From: nospam@bba.com (Lisa Ansellotti)
Subject: curses and multithreading
Date: Tue, 04 Aug 2009 22:43:53 +0200
Date: 2009-08-04T22:43:53+02:00	[thread overview]
Message-ID: <h5a6i9$sg$1@news.newsland.it> (raw)

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





             reply	other threads:[~2009-08-04 20:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-04 20:43 Lisa Ansellotti [this message]
2009-08-05  8:17 ` curses and multithreading Jean-Pierre Rosen
2009-08-05 17:20   ` Lisa Ansellotti
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox