|
Re: does IDL support multi threading [message #31099 is a reply to message #31086] |
Sat, 15 June 2002 12:44  |
Paul Sorenson
Messages: 48 Registered: May 2002
|
Member |
|
|
"Gary Muswick" <muswick@uhrad.com> wrote in message
news:177004ba.0206150545.4b583636@posting.google.com...
>
> Second, If the procedure you are working with has a big loop and the
> cpu time per loop is small, then you can call WIDGET_EVENT within your
> loop and handle the events of your GUI yourself. If there are no
> events, then you go right back to processing another loop iteration.
>
DEMO_TOUR does this. You can see the demo tour run by typing 'demo_tour' at
the IDL prompt.
Paul Sorenson
-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
http://www.newsfeed.com The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
|
|
|
Re: does IDL support multi threading [message #31100 is a reply to message #31099] |
Sat, 15 June 2002 06:45  |
muswick
Messages: 10 Registered: April 1998
|
Junior Member |
|
|
"Ashwin" <Ashwin.Krishnakumar@philips.com> wrote in message news:<3d073a06$0$229$4d4ebb8e@read-nat.news.nl.uu.net>...
> I have a GUI written using IDL .When a procedure is executing i am not able
> to select/click any button on GUI.i.e the GUI is completely inactive and
> does not respond to the user inputs untill the procedure is completed. How
> to make the GUI have a higher priority than other procedures.
IDL does not support true multithreading, but there are a few tricks.
Here are two solutions you can try (there are others, but it gets more
complicated.)
First, If the procedure you are executing is working on data that the
GUI doesn't need access to, e.g. you have a large volume of data and
you want perform a series of operations, like a radon transform
reconstruction and save the results to a file for later display, then
you could save your data, write the procedures to a batch or script
file, then spawn off a second IDL session with /nowait to do the work.
Have the script create a done.dat file when it is done. (if you
running Unix you can use a pipe to communicate) Have your GUI check
periodically for the existance of the done.dat file. The OS handles
the the multi-processing.
Second, If the procedure you are working with has a big loop and the
cpu time per loop is small, then you can call WIDGET_EVENT within your
loop and handle the events of your GUI yourself. If there are no
events, then you go right back to processing another loop iteration.
I have done this many times, and it works quite well. However - be
careful to block GUI events you don't want repeated. E.g. if your
loop was to process a hundred CT images and create output files, you
don't want to invoke it a second time if the first one is not done.
The easiest way to do this, is set the widgets you don't want to
re-invoke with a sensitive=0. When your done processing, make the
widget sensitive again.
Gary Muswick
University Hospitals of Cleveland
|
|
|
Re: does IDL support multi threading [message #31126 is a reply to message #31100] |
Wed, 12 June 2002 07:14  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Ashwin (Ashwin.Krishnakumar@philips.com) writes:
> I have a GUI written using IDL .When a procedure is executing i am not able
> to select/click any button on GUI.i.e the GUI is completely inactive and
> does not respond to the user inputs untill the procedure is completed. How
> to make the GUI have a higher priority than other procedures.
Ain't a gonna happen. Sorry. :-(
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|