[Top][All Lists]

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

[bugs #8374] NSNotificationCenter can deadlock

From: Willem Rein Oudshoorn
Subject: [bugs #8374] NSNotificationCenter can deadlock
Date: Thu, 01 Apr 2004 08:29:51 -0500
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6) Gecko/20040206 Firefox/0.8

This mail is an automated notification from the bugs tracker
 of the project: GNUstep.

[bugs #8374] Latest Modifications:

Changes by: 
                Willem Rein Oudshoorn <address@hidden>
                Thu 04/01/04 at 13:29 (Europe/Amsterdam)

------------------ Additional Follow-up Comments ----------------------------
Seems to have solved my problems. 
About the new bugs, I don't know :-)

[bugs #8374] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=8374>
Project: GNUstep
Submitted by: Willem Rein Oudshoorn
On: Tue 03/30/04 at 13:13

Category:  Base/Foundation
Severity:  3 - Ordinary
Item Group:  Bug
Resolution:  Fixed
Assigned to:  None
Status:  Closed

Summary:  NSNotificationCenter can deadlock

Original Submission:  There is a lock protecting the list of notifications.  
This lock is grabbed before sending the notifications and released after 
sending the notifications.  

This can lead to a deadlock when multiple threads are using the notification 
center.   The attached program shows in a very artificial situation how the 
deadlock can occur.  

I just spend 3 days figuring this out in a complicated situation involving 
multiple threads, DO and launched tasks.  
So it is not just a theoretical problem.

I have not looked deeply at it, but probably just
making a copy instead of maintaining the lock will solve it.
(But I have to look again.)

Wim Oudshoorn

Follow-up Comments

Date: Thu 04/01/04 at 13:29         By: wim
Seems to have solved my problems. 
About the new bugs, I don't know :-)

Date: Wed 03/31/04 at 13:26         By: CaS
We use DO and notifications in a threaded environment (inside java servlet 
engine) where I work, so a possible deadlock there is potentially a serious 
issue for us ... so I spent a
bit of company time on this.

I've rewritten the notification posting code to post when the center is 
unlocked (and also simplified it a bit).  This seems to fix your problem and I 
haven't had any other trouble with it.
Please can you try it out (the changes are in CVS now) and let me know if I've 
introduced any other bugs :-)

File Attachments

Date: Tue 03/30/04 at 13:13  Name: deadlocktest.tar.gz  Size: 837KB   By: wim
Example of NSNotificationCenter deadlock.  

For detailed info, follow this link:

  Message sent via/by Savannah

reply via email to

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