postNotification Deadlock

Please post support and help requests here.
Posts: 11
Joined: 17 Feb 2009, 17:43

postNotification Deadlock

Postby DougE » 05 Jul 2013, 20:24


I'm developing using POCO 1.4.5 and VS 2010 C++ unmanaged.

I'm using a TCPServer. I use the default NotificationCenter to implement a pause function. I do a postNotification and each one of the ServerConnection threads has a handler that just sets a flag. This code works fine in all my tests. However, if the current handlers ServerConnection thread is still doing some work it waits for it to finish before exiting. If my worker thread does a postNotification of a different Notification that is handled in a different class and thread I get a deadlock AFTER my handler code exits but BEFORE it returns from the postNotification.

<1> worker A - in job method
<1> worker A - call postNotification(Notification X)
<1> worker B - Notification X handler
<1> worker B - wait for worker B thread to finish its job
<2> worker B - in job method
<2> worker B - call postNotification(Notification Y)
<9> outputter - Notification Y handler
<9> outputter - enqueue stuff
<9> outputter - exit
<2> worker B - never gets back to job method
<1> worker A - never gets back to Notifcation handler

It appears that the notification dispatching is getting hung. Do you think so? Any suggestions on different approach? Event? Asynch? Or a code fix?

Doug Miller

Posts: 5
Joined: 03 Feb 2017, 09:14

Re: postNotification Deadlock

Postby shrinivask » 08 Feb 2017, 16:19

Hi DougE,

Thanks for your post. We are also facing similar kind of issue with latest POCO release.
Did you resolved this issue ? Please let us know how to fix it :D

Thanks in advance


Posts: 12
Joined: 11 Sep 2014, 16:41

Re: postNotification Deadlock

Postby bgolenko » 01 Mar 2017, 17:49

I believe I have been mentioning this (or similar) issue quite some time ago.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 3 guests