← Back to team overview

linuxdcpp-team team mailing list archive

Re: [Merge] lp:~gpr/dcplusplus/sync into lp:dcplusplus

 

My motivation for writing all this patches (besides bug in using pthread_cond) was bad (coarse) locking for unix. It uses one static mutex in Thread class for almost all synchronization in the whole code.

While I agree that spinning is suitable for FastCriticalSection, it's not easy to implement it properly and effective. At first glance, current implementation may be subject to priority inversion, and therefore, deadlocks.

I'm not sure, what solution will be acceptable for both unix and windows. For intrusive_ptr, I'd just use boost shared_ptr/atomic (as in my patch). For critical sections, I think correctness is priority, and then optimization. And portability is also good.

-- 
https://code.launchpad.net/~gpr/dcplusplus/sync/+merge/32912
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.



References