discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use Appkit with NSThread


From: Nicola Pero
Subject: Re: How to use Appkit with NSThread
Date: Thu, 17 Jan 2002 22:40:41 +0000 (GMT)

Hi St\'ephan,

gnustep-gui is not thread-safe, so if you have one thread accessing
gnustep-gui, the other threads must not access it.

In general, my very warm suggestion is - don't use threads if you can !

It's quite possible that you can integrate your background processing into
the application run loop ... and have it work simultaneously with the
foreground processing without using threads.

Anyway, since this is seems to be a frequently asked question, and I had
still in my TODO list the task of writing a new NSProgressIndicator
demo/example, I wrote one which spans an auxiliary thread - the main
thread shows on screen the progress of the auxiliary thread processing by
using a NSProgressIndicator.

The example is on CVS, 

examples/gui/Classes/NSProgressIndicator/Threads/

> Hi all,
> 
> I'm working on an application that will encod tracks from audio-cd. 
> 
> I want to display a progress panel with progress indicators.
> For that, I use a static method to update the progress indicators of this 
> panel.
> 
> I use specific music libraries too that must be called in a thread. If not, 
> the application freeze.
> 
> When I call these libraries, I get some real time information that I want to 
> use to update the progress panel.
> 
> My problem today is that I can't call directly my static method (that work 
> with appkit) in an NSThread object ! 
> (It compils but I have a core at execution)
> 
> So my question : How could I call in a thread this method that use the appkit 
> ?
> Should I rather use a thread in pure c ?
> 
> Thanks for help
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]