Solved

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

Posted on 2004-09-10
1
181 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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now