Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

parallel processes in TCL/TK

28 views
Skip to first unread message

Niall Gaffney

unread,
Jun 11, 1996, 3:00:00 AM6/11/96
to

Hi,

I am trying to write a TCL/TK routine to monitor the motion of a
telescope. It needs to be able to attach to some socket listening
process and watch the numbers come in while setting some global
variables for the display. I need the display code to be forked off
from the socket code so the display can change and buttons pressed (etc)
while the other half is listening for more info from the socket. Any
hints, clues or other bits of info on how this may be best achieved?

Thanks
Niall
--
==============================================================
Niall Gaffney ni...@rhea.as.utexas.edu
HET Operations http://rhea.as.utexas.edu/~niall

Gerald W. Lester

unread,
Jun 12, 1996, 3:00:00 AM6/12/96
to ni...@rhea.as.utexas.edu

Niall Gaffney wrote:
>
> Hi,
>
> I am trying to write a TCL/TK routine to monitor the motion of a
> telescope. It needs to be able to attach to some socket listening
> process and watch the numbers come in while setting some global
> variables for the display. I need the display code to be forked off
> from the socket code so the display can change and buttons pressed (etc)
> while the other half is listening for more info from the socket. Any
> hints, clues or other bits of info on how this may be best achieved?

Actually, you don't need two processes. Use the fileevent command to
receive events when the socket is readable.

**********************************************************************
* Gerald W. Lester | Voice: +1 (504)-889-2784 *
* Computerized Processes Unlimited, Inc. | FAX: +1 (504)-889-2799 *
* 4200 S. I-10 Service Rd., Suite 205 | E-Mail: g...@cpu.com *
* Metairie, LA 70001 | WWW: http://www.cpu.com *
* "Consulting System Integrators" *
**********************************************************************

Cameron Laird

unread,
Jun 12, 1996, 3:00:00 AM6/12/96
to

In article <31BDA7...@rhea.as.utexas.edu>,

Niall Gaffney <ni...@rhea.as.utexas.edu> wrote:
>Hi,
>
>I am trying to write a TCL/TK routine to monitor the motion of a
>telescope. It needs to be able to attach to some socket listening
>process and watch the numbers come in while setting some global
>variables for the display. I need the display code to be forked off
>from the socket code so the display can change and buttons pressed (etc)
>while the other half is listening for more info from the socket. Any
>hints, clues or other bits of info on how this may be best achieved?
.
.
.
You don't need sophisticated parallelism constructs
for this. Stock Tk4.1 has plenty to facilitate the
application you describe. The display code can be
utterly conventional, and all you need to do is put
some sort of fileevent (that's the name of a built-
in) to react when data appear at the socket. Look
at the documentation for "fileevent" and perhaps the
Tk event loop; you'll do fine.
--

Cameron Laird http://starbase.neosoft.com/~claird/home.html
cla...@NeoSoft.com +1 713 623 8000 #227
+1 713 996 8546 FAX

William Moyne

unread,
Jun 22, 1996, 3:00:00 AM6/22/96
to

Gerald W. Lester (gwle...@cpu.com) wrote:

: Niall Gaffney wrote:
: >
: > Hi,
: >
: > I am trying to write a TCL/TK routine to monitor the motion of a
: > telescope. It needs to be able to attach to some socket listening
: > process and watch the numbers come in while setting some global
: > variables for the display. I need the display code to be forked off
: > from the socket code so the display can change and buttons pressed (etc)
: > while the other half is listening for more info from the socket. Any
: > hints, clues or other bits of info on how this may be best achieved?
:
: Actually, you don't need two processes. Use the fileevent command to
: receive events when the socket is readable.
:
You could also use dp_filehandler under tcldp to execute some code when
the port became readable.

-- William

--------
Teaching Assistant by day, Research Assistant by night
MSEECS 2-'95 Massachusetts Institute of Technology Bld 36, Rm 279
e-mail: wpm...@mit.edu WWW: http://www-mtl.mit.edu/~wpmoyne/

0 new messages