Solved

C/Motif/*nix: Long processing is locking out the GUI window.

Posted on 2004-09-10
1
210 Views
Last Modified: 2010-04-15
I have an application in C/Motif on Solaris which will go off into some long processing routines which can last several minutes (basically opening large files, reading and manipulating data, then writing out to a new file in a different format).  This long processing is started in a Callback function.  During this time the GUI main window is essentially locked up.  Now, it's not completely locked up because I'm dumping info to a text window and the window is occasionally updated, but the user is not able to access any menus, etc.  I assume it's simply because the processing function is eating all the CPU time.  Once the Callback process completes the window is accessible again.  BTW, I'm running CDE and all other windows outside my application are still active.  Is there a solution to this?
0
Comment
Question by:jimdgar
1 Comment
 
LVL 23

Accepted Solution

by:
brettmjohnson earned 125 total points
ID: 12029660
I think you should probably run the long processing routines in a separate thread.
Have the callback routine spawn the thread.  Have the background thread send
messages to the main thread, which can display the status in the GUI.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
stack 22 173
difference between mmap and malloc/valloc + mmap fixed 18 274
C Language combined operators 28 120
How to creat good software interface ? 1 70
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question