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

Group
 
 

bug #14759: NSApplication image multithreading problem

Submitter:  None
Submitted:  Mon 10 Oct 2005 12:22:11 PM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Change Request Status:  Wont Fix
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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>
Group 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>
Group 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>
Group 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>
Group 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

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

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

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 6 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-11-21 FredKiefer StatusNone Wont Fix
    Open/ClosedOpen Closed
2005-10-12 qmathe Item GroupBug Change Request
    StatusInvalid None
2005-10-11 qmathe StatusNone Invalid
2005-10-10 None Attached File- Added ThreadTest.tar.gz, #3036

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code