You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bot detected the issue body's language is not English, translate it automatically.
Title: Can the size in the singly linked list add atomic operation qualifiers
Use tbox to implement a producer-consumer model, which includes producer semaphores, consumer semaphores, queues, and locks. During debugging, it is found that the lock operation is too time-consuming, so I want to remove the lock. However, it is found that the queue is implemented with a single-linked list, and the single-linked list has self-increment and self-decrement operations on the variable size, which will cause problems under multi-core.
Is there any solution? I want to change the type of size to tb_atomic_t, and then change all size-related operations, is it possible?
用tbox实现一个生产者消费者模型,其中包含了生产者信号量、消费者信号量、队列、锁,调试中发现锁操作太耗时,想着去掉锁。但发现队列是用单链表实现的,而单链表里有对变量size进行自增自减操作,这个在多核下会出问题。
有什么解决办法吗?想着将size的类型改成tb_atomic_t,然后把size相关的操作都改下,可以吗?
The text was updated successfully, but these errors were encountered: