Solved

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

Posted on 2004-09-10
1
204 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

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…
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…
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.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

792 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