comp.lang.ada
 help / color / mirror / Atom feed
From: Patrick Hohmeyer <pi3_1415926536@yahoo.ca>
Subject: Re: Timeout or agreement
Date: Mon, 11 Mar 2002 20:38:45 -0500
Date: 2002-03-11T20:38:45-05:00	[thread overview]
Message-ID: <WXcj8.12798$Yg2.1060718@news20.bellglobal.com> (raw)
In-Reply-To: a6jial$6b8$1@wanadoo.fr

And Meresup wrote :

> My problem is to wait for the agreement of a sub routine or raise an
> response_error exception on timeout. It's so easy to do it with logical
> programming that I don't see the way to do it in a sequential programm.
> Can u help?
> 
> Explanation :
> I send a data to serial port
> I'd like to wait for the OK flag of the called procedure or a timeout.
> What could be the correct structure????????

TASK, what you need is a task.

To do what you want you need a second thread or process (always).
Your logical language seems to encapsulate the thread creation for you,
in Ada you need to define a task or a task type.
This is a rather complicated matter, so search yourself a book /
online tutorial about it.

Another word :
As you probably want to stop the thread waiting on the serial port,
you may run into problems.
Stopping a task in the middle of it's execution can leave the
system in an inconsistent state, so be sure to find a *very* *good*
exemple befor doing it.

Have fun ;-)

-- 
Patrick Hohmeyer



  parent reply	other threads:[~2002-03-12  1:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-12  0:32 Timeout or agreement Meresup
2002-03-12  0:58 ` may i be more explicit? Meresup
2002-03-12  1:50   ` tmoran
2002-03-12  1:38 ` Patrick Hohmeyer [this message]
2002-03-12 17:18 ` Timeout or agreement Meresup
replies disabled

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