linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #07086
[Bug 1194299] Re: Threading issues in hub management
That's probably stable.. but I also thought that using the listener lock
might be more logical so that running async tasks wouldn't block the
calling thread when new (async) tasks are queued (BufferedSocked could
probably use lockfree queue instead of locking anyway). This hasn't been
tested:
=== modified file dcpp/BufferedSocket.cpp
--- dcpp/BufferedSocket.cpp 2013-06-25 15:45:51 +0000
+++ dcpp/BufferedSocket.cpp 2013-06-25 17:36:31 +0000
@@ -454,7 +454,7 @@
return false;
} else if(p.first == ASYNC_CALL) {
- if(!disconnecting) { static_cast<CallData*>(p.second.get())->f(); }
+ if(!disconnecting) { Lock l(listenerCS); static_cast<CallData*>(p.second.get())->f(); }
continue;
}
=== modified file dcpp/BufferedSocket.h
--- dcpp/BufferedSocket.h 2013-06-25 15:45:51 +0000
+++ dcpp/BufferedSocket.h 2013-06-25 17:36:14 +0000
@@ -63,8 +63,8 @@
static void putSocket(BufferedSocket* aSock) {
if(aSock) {
+ aSock->shutdown();
aSock->removeListeners();
- aSock->shutdown();
}
}
--
You received this bug notification because you are a member of
Dcplusplus-team, which is subscribed to DC++.
https://bugs.launchpad.net/bugs/1194299
Title:
Threading issues in hub management
Status in DC++:
Fix Committed
Bug description:
AdcHub::info is called from various different threads (timer, refresh,
hub, GUI) but it's not thread safe. lastInfoMap is unprotected while
it can be modified from different threads simultaneously. This has
been fixed in AirDC++ by syncing the info calls from other threads to
the hub thread.
Client::updateCounts is another function that shouldn't be called from
different threads because the hub counts may go wrong. This started to
cause real problems in AirDC++ when the info calls from TimerManager
were synced to the hub threads, which caused them to get executed
asynchronously all the time.
To manage notifications about this bug go to:
https://bugs.launchpad.net/dcplusplus/+bug/1194299/+subscriptions
References