bugGNUstep - Bugs: bug #8374, NSNotificationCenter can deadlock

 
 

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

bug #8374: NSNotificationCenter can deadlock

Submitted by:  Willem Rein Oudshoorn <wim>
Submitted on:  Tue 30 Mar 2004 01:13:12 PM UTC  
 
Category: Base/FoundationSeverity: 2 - Minor
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Thu 01 Apr 2004 01:29:49 PM UTC, comment #2:

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

Willem Rein Oudshoorn <wim>
Project Member
Wed 31 Mar 2004 01:26:59 PM UTC, comment #1:

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 :-)

Richard Frith-Macdonald <CaS>
Project Member
Tue 30 Mar 2004 01:13:12 PM UTC, 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

Willem Rein Oudshoorn <wim>
Project Member

 

Attached Files
file #1161:  deadlocktest.tar.gz added by wim (837B - application/x-gzip - Example of NSNotificationCenter deadlock. )

 

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 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 31 Mar 2004 01:26:59 PM UTCCaSOpen/ClosedOpen=>Closed
Wed 31 Mar 2004 01:26:58 PM UTCCaSStatusNone=>Fixed
Tue 30 Mar 2004 01:13:12 PM UTCwimAttached File-=>Added deadlocktest.tar.gz, #1143

Back to the top


Powered by Savane 3.1-cleanup1