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

ShareMemory 实现中存在的问题, 请确认 #78

Open
nelsonjin opened this issue Nov 30, 2018 · 2 comments
Open

ShareMemory 实现中存在的问题, 请确认 #78

nelsonjin opened this issue Nov 30, 2018 · 2 comments
Assignees
Labels

Comments

@nelsonjin
Copy link

前提: 这里仅讨论使用ShareMemory的场景

  1. mutex释放、reader_count不减问题。Subscribe端获取Manager中的mutex后,读ShareMemory内存慢会导致Block被占住。如果这样的subscriber如果占住所有block, 或者有subscriber异常退出没有释放导致block中的reader_count 不减,Publisher一端将无法写入问题, 且会在找可用block的循环逻辑里面,导致CPU 100%。

  2. TOPIC ShareMemory重置问题。 当需要publish的新消息长度超过计算出来的消息长度时,会丢弃对用Topic里面的数据, 哪怕数据没有被其他端消费。且重建ShareMemory的逻辑导致了整体代码过于复杂。

  3. 丢消息问题。Publisher 通过Signal唤醒Subscribers收取数据, 但是如果Subscriber没有及时收走数, 而Publisher publish速度较快, 会导致Subscriber拿到的智能是wrote_num对应的数据, 而不能取到当前Subscriber last_index -> wrote_num 之间的数据

麻烦开发者帮我确认一下, 先谢了。

@mjjdick
Copy link

mjjdick commented May 12, 2023

@nelsonjin 我也发现确实存在第一个问题,异常退出的时候,shared mem基本上不再可用。有没有什么办法可以解决呢?

@daohu527
Copy link

Thanks for your feedback, but I suggest if this is cyber related. I will check and feedback soon

@daohu527 daohu527 self-assigned this May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants