Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Busy loop in CpiDeviceList::NotifyRefreshed
12-03-2012, 12:03 PM
Post: #1
Busy loop in CpiDeviceList::NotifyRefreshed
Under certain circumstances (see below for details), I'm getting a busy loop in CpiDeviceList::NotifyRefreshed. The while loop is continually running through this section of code:

device->AddRef();
iLock.Signal();
DoRemove(*device);
device->RemoveRef();
iLock.Wait();
it = iMap.begin();

with the same value for device. This is happening thousands of times.

The problem occurs when the control point does a refresh during an unusual network condition that prevents multicast messages being received by the control point. The control point is able to receive unicast messages and is able to send both multicast and unicast messages.

I'm using a fairly old (January) level of ohNet. Have any problems that could explain this looping been discovered and fixed in recent weeks?
Find all posts by this user
12-03-2012, 12:10 PM
Post: #2
RE: Busy loop in CpiDeviceList::NotifyRefreshed
(12-03-2012 12:03 PM)simoncn Wrote:  Under certain circumstances (see below for details), I'm getting a busy loop in CpiDeviceList::NotifyRefreshed.

[snip]

I'm using a fairly old (January) level of ohNet. Have any problems that could explain this looping been discovered and fixed in recent weeks?

Looks like I might have beaten you to it for once Smile.

https://github.com/openhome/ohNet/commit...Device.cpp shows a commit on Jan 11th which changes this area of code to fix a similar sounding problem. Can you update to the latest code and try again please?

In case it helps in future, navigating to a file in github then selecting History shows you a list of commits to that file. It'll sometimes be possible to use this to help determine whether any potential fixes are available.
Find all posts by this user
12-03-2012, 12:35 PM
Post: #3
RE: Busy loop in CpiDeviceList::NotifyRefreshed
(12-03-2012 12:10 PM)simonc Wrote:  Looks like I might have beaten you to it for once Smile.

https://github.com/openhome/ohNet/commit...Device.cpp shows a commit on Jan 11th which changes this area of code to fix a similar sounding problem. Can you update to the latest code and try again please?

In case it helps in future, navigating to a file in github then selecting History shows you a list of commits to that file. It'll sometimes be possible to use this to help determine whether any potential fixes are available.

Thanks for the very quick reply. It turns out that I do have this fix in my production code, but I encountered the loop problem when running with a slightly older level of test code (built with debug symbols) which didn't have the fix.
Find all posts by this user


Forum Jump: