portable FastCriticalSection implementation
Bug #617757 reported by
Gennady Proskurin
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DC++ |
Fix Released
|
Undecided
|
Unassigned | ||
LinuxDC++ |
Confirmed
|
Low
|
Unassigned |
Bug Description
patch attached.
It may have benefits on win32, the old implementation used sleep(1) in "fast" critical section (Thread::yield).
Now Thread::yield seems to be unused, I think it should be removed, it's dangerous. Incorrectly using scheduler's yield may lead to unnecessary cpu consumption.
I tested only unix after patching this.
Related branches
lp://staging/~gpr/linuxdcpp/sync
Ready for review
for merging
into
lp://staging/linuxdcpp
- LinuxDC++ Team: Pending requested
-
Diff: 489 lines (+171/-91)12 files modifieddcpp/Atomic.h (+122/-0)
dcpp/BufferedSocket.cpp (+3/-3)
dcpp/BufferedSocket.h (+5/-1)
dcpp/Client.cpp (+6/-6)
dcpp/Client.h (+14/-6)
dcpp/CriticalSection.h (+7/-27)
dcpp/Pointer.h (+4/-4)
dcpp/Semaphore.h (+5/-2)
dcpp/ShareManager.cpp (+3/-3)
dcpp/ShareManager.h (+2/-1)
dcpp/Thread.cpp (+0/-4)
dcpp/Thread.h (+0/-34)
lp://staging/~gpr/dcplusplus/sync
Ready for review
for merging
into
lp://staging/dcplusplus
- Jacek Sieka: Needs Information
-
Diff: 408 lines (+171/-53)10 files modifieddcpp/Atomic.h (+122/-0)
dcpp/BufferedSocket.cpp (+3/-3)
dcpp/BufferedSocket.h (+5/-1)
dcpp/Client.cpp (+6/-6)
dcpp/Client.h (+14/-6)
dcpp/CriticalSection.h (+7/-27)
dcpp/Pointer.h (+4/-4)
dcpp/Semaphore.h (+5/-2)
dcpp/ShareManager.cpp (+3/-3)
dcpp/ShareManager.h (+2/-1)
Changed in dcplusplus: | |
status: | New → Fix Committed |
To post a comment you must log in.
Gennady, these patches you've submitted modify both the windows and linux core, so they would need to be reviewed by the dcplusplus team. We cannot apply changes to linuxdcpp without them also being applied to upstream dc++. The only one that is linux specific is bug #617021, which me or Razzloss can review.
However, your patches/branch are for linuxdcpp which is not up to date with the latest dc++ core. You may have to redo your patches for the dc++ core. But before you do that, I would suggest waiting on a response from the dc++ team to see if they would be interested in your patches before you go through that effort.
Poy et al, can you take a look at these patches that Gennady submitted (this and the other bugs he filed)? They probably won't apply, but you can get an idea from the diff and if it's something that you approve of either Gennady or I can port it to the new core.