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

Thread for scheduling

1 view
Skip to first unread message

csja...@wisc.edu

unread,
Sep 2, 2005, 6:45:28 PM9/2/05
to
I would like to be able to create a thread that uses a schedule
(located in a file) and continues to run and do a system call when the
time is right. I have most of it implimented but I am having a problem
keeping the main interface active while allowing the 2nd thread (my
system caller) to still function at the correct time.

I have a Tk interface that upon the click of a start button, will start
an already created and stopped thread.

I am use thread.run to do this. However, if I do not use thread.join
afterwards it seems that the thread goes to sleep as I want it to, but
then never wakes up:(

If I use thread.join it does everything fine, but my main process (the
user interface) is locked and can not do anything.

So how can I make it so my interface is still active and my secondary
thread is running in the background doing the system calls when the
time is right?

Ara.T.Howard

unread,
Sep 2, 2005, 7:40:22 PM9/2/05
to

this is __exactly__ what i wrote session for - to allow a gui thread to run
background commands in a way that does not block the calling thread. so,
__assuming__ your threaded programming is right try

require 'session'

Session::new do |sh|
stdout, stderr, sh.execute command
status = sh.status
end

to run your commands in thread. session is on the raa.

hth.

-a
--
===============================================================================
| email :: ara [dot] t [dot] howard [at] noaa [dot] gov
| phone :: 303.497.6469
| Your life dwells amoung the causes of death
| Like a lamp standing in a strong breeze. --Nagarjuna
===============================================================================

0 new messages