bugGNUstep - Bugs: bug #14759, NSApplication image multithreading...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #14759: NSApplication image multithreading problem

Submitted by:  None
Submitted on:  Mon 10 Oct 2005 12:22:11 PM UTC  
 
Category: Gui/AppKitSeverity: 3 - Normal
Item Group: Change RequestStatus: Wont Fix
Privacy: PublicAssigned to: None
Open/Closed: Closed

(Jump to the original submission Jump to the original submission)

Mon 21 Nov 2005 01:23:07 PM UTC, comment #6:

Closed as we seem to have agreed on calling it a feature not a bug :-)

Fred Kiefer <FredKiefer>
Project Member
Wed 19 Oct 2005 03:36:15 PM UTC, comment #5:

Thanks for your help.

Especially the mentioning of the performSelectorOnMainThread-Method
sounds very useful for solving the problem. :-)

-Guenther

Anonymous
Wed 12 Oct 2005 02:40:54 PM UTC, comment #4:

Thanks for the correction Fred.
… otherwise I have run the project on Mac OS X with Cocoa and the issue doesn't appear. That means we may add a -performSelectorOnMainThread:withObject:waitUntilDone in -changeIcon method to match Cocoa behavior.
To take this in account, I have turned this bug in a change request.

Quentin Mathé <qmathe>
Project Member
Tue 11 Oct 2005 10:55:13 PM UTC, comment #3:

Quentin, I think that performSelectorOnMainThread:withObject:waitUntilDone: is implemented in base and hope that it is actually working correctly, as it gets used by the gui view refreshing quiet heavily.

Fred Kiefer <FredKiefer>
Project Member
Tue 11 Oct 2005 02:09:09 PM UTC, comment #2:

Here are some notes on which Cocoa classes are thread safe or not: <http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/articles/CocoaSafety.html>
In theory, AppKit is not really thread-safe except for drawing operations which involve NSView, NSString, NSBezierPath.
I think this -setApplicationImage: method is relying on NSImage which is not thread-safe. According to Cocoa documentation, NSImage can draw in its own buffer within a thread, I don't know if GNUstep NSImage is implemented in a similar fashion.

-setApplicationImage: should be called with DO or with -[NSObject performSelectorOnMainThread:withObject:waitUntilDone:] (still not implemented in -base iirc)

We should close this bug probably ? Unless we decide to have NSApplication fully thread-safe; -performSelectorOnMainThread:withObject:waitUntilDone: has probably to be implemented then.

Quentin Mathé <qmathe>
Project Member
Mon 10 Oct 2005 05:21:41 PM UTC, comment #1:

I know the gui library, and NSApplication, is not supposed to be thread-safe, so anything related to drawing is supposed to nbe done in the main thread.

Does that mean that this report is invalid? Or do we want to make -setApplicationImage: be thread safe (by checking the current thread, and doing the work in the main thread if it's called from another one).

Richard Frith-Macdonald <CaS>
Project Member
Mon 10 Oct 2005 12:22:11 PM UTC, original submission:

When sending the [NSApp setApplicationImage: image] message,
the application icon is supposed to change to the new icon.
When invoking it from a thread, which is not the main thread,
this doesn't happen. Instead, there are only to centered
pixels available in the dock item. These seem to change when
changing the icon, but it's just too small.

I use GNUstep startup from August 2005 and WindowMaker 0.9.

I experienced the problem when developing RSS Reader, but I
was also able to reproduce the error using a minimal
application which is able to change the app icon from the
main and another thread.

It can be downloaded from http://www.unix-ag.uni-kl.de/~guenther/ThreadTest.tar.gz (also attached)

-Guenther Noack

Anonymous

 

Attached Files
file #2955:  ThreadTest.tar.gz added by None (6KiB - application/x-gzip - minimal application which reproduces the problem on current GNUstep environments)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 6 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Mon 21 Nov 2005 01:23:07 PM UTCFredKieferStatusNone=>Wont Fix
  Open/ClosedOpen=>Closed
Wed 12 Oct 2005 02:40:54 PM UTCqmatheItem GroupBug=>Change Request
  StatusInvalid=>None
Tue 11 Oct 2005 02:09:09 PM UTCqmatheStatusNone=>Invalid
Mon 10 Oct 2005 12:22:11 PM UTCNoneAttached File-=>Added ThreadTest.tar.gz, #3036

Back to the top


Powered by Savane 3.1-cleanup1