Q: call_external hangs IDL Windows GUI? [message #43613] |
Wed, 20 April 2005 11:31  |
Joshua Lynch
Messages: 3 Registered: April 2005
|
Junior Member |
|
|
Hello,
I have an application that uses call_external to call a C function
which waits for some network input and then returns. Unfortunately
it seems that entire IDL IDE hangs for every call to call_external.
Is this, in fact, a correct assumption?
I've tested the same application under Unix and it does not hang the
IDE.
It seems as though when I'm running the application and don't click
anywhere in the IDE, it runs fine (sort of, it prints its data out 2,
3, 4 five lines at a time, instead of smoothly, one at a time). As
soon as I click anywhere in the IDE the menu bar disappears and if I
click again the title bar displays the dreaded "Application Not
Responding" string.
My guess is that the IDE is stopped while waiting for the C function
to return?
Am I missing something simple?
Thanks in advance.
--josh
|
|
|
Re: Q: call_external hangs IDL Windows GUI? [message #43737 is a reply to message #43613] |
Fri, 22 April 2005 14:35   |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
Yes, same goes. :(
-Rick
Joshua Lynch wrote:
> Do DLMs suffer the same blocking problem under Windows?
>
> Thanks for the response!
>
>
> --josh
>
>
> b_gom@hotmail.com wrote:
>
>> Joshua,
>>
>> call_external does block in Windows (there is no multithreading in the
>> IDL interpreter) You can, however, call an external function that
>> starts a thread and then returns quickly to IDL. You will have to sort
>> out the messaging between the threads on your own though.
>>
>> Good luck,
>>
>> Brad
>>
>> Joshua Lynch wrote:
>>
>>> Hello,
>>> I have an application that uses call_external to call a C function
>>> which waits for some network input and then returns. Unfortunately
>>> it seems that entire IDL IDE hangs for every call to call_external.
>>>
>>> Is this, in fact, a correct assumption?
>>>
>>> I've tested the same application under Unix and it does not hang the
>>> IDE.
>>>
>>> It seems as though when I'm running the application and don't click
>>> anywhere in the IDE, it runs fine (sort of, it prints its data out 2,
>>> 3, 4 five lines at a time, instead of smoothly, one at a time). As
>>> soon as I click anywhere in the IDE the menu bar disappears and if I
>>> click again the title bar displays the dreaded "Application Not
>>> Responding" string.
>>>
>>> My guess is that the IDE is stopped while waiting for the C function
>>> to return?
>>>
>>> Am I missing something simple?
>>>
>>> Thanks in advance.
>>>
>>>
>>> --josh
>>
|
|
|
Re: Q: call_external hangs IDL Windows GUI? [message #43757 is a reply to message #43613] |
Wed, 27 April 2005 09:09  |
b_gom
Messages: 105 Registered: April 2003
|
Senior Member |
|
|
Josh,
not knowing exactly what you want to do, I'd suggest making a DLM with
one function that spawns a thread for computation, and another function
that polls to see if the thread is complete (by checking a global
variable for example). In IDL you'd either stay in a loop until the
polling function succeeds, or you'd set up a timer widget to
periodically check the thread status.
Brad
Joshua Lynch wrote:
> b_gom@hotmail.com wrote:
>> Joshua,
>>
>> call_external does block in Windows (there is no multi-threading in
the
>> IDL interpreter) You can, however, call an external function that
>> starts a thread and then returns quickly to IDL. You will have to
sort
>> out the messaging between the threads on your own though.
>>
>
> Any suggestions on how to make IDL wait until the thread is
completed?
> Is there a way to block on a variable (preferably not to busy wait)
in
> IDL and have the C code modify it? Or should I just go RTFM? :-)
>
> Thanks again.
>
>
> --josh
|
|
|