Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

什么时候能时候能够实现无锁化?(Do you have a plan of no locker for threads?) #70

Open
xlnrony opened this issue Sep 19, 2019 · 5 comments

Comments

@xlnrony
Copy link

xlnrony commented Sep 19, 2019

有无锁化的计划吗?Do you have a plan of no locker for threads?

@pony5551
Copy link

无锁就是cas,有时性能可能会更差!正在的无锁是线程独立运行,每个线程操作自己的部分,设计上非常麻烦

@viniciusfbb
Copy link
Contributor

viniciusfbb commented Sep 19, 2019

The library is multithreaded (CPUCount * 2 + 1), with each thread running independently without lockers

@pony5551
Copy link

The library is multithreaded (CPUCount * 2 + 1), with each thread running independently without lockers

TMonitor.Enter is used in many places in the code, so locks are used!

@pony5551
Copy link

最主要的是CreateConnection,不停创建对象,这个从MM管理器中申请内存,是使用锁的!最好使用无锁对象池!

@viniciusfbb
Copy link
Contributor

viniciusfbb commented May 4, 2020

@pony5551 You're right! I only use the TCP server with my own protocol, but even in my case CrossSocket actively uses 1 TMonitor, which is the connection one, to have the list of active connections. This lock is inevitable, but what can be done is to reduce the operations inside the locks as much as possible reviewing all locks.
One simple example is here f5ffd21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants