Call Sequence:
1 call to enqueue, inserting value 4.
2.After a 50ms interval, second call to enqueue, inserting value 0.
3.Within less than 1ms, first call to try_dequeue, retrieving value 0.
4Within less than 1ms, second call to try_dequeue, retrieving value 4.
The first enqueue operation (ImplicitProducer::enqueue) inserts value 4 into an instance (e.g., 0x0000007f28001920).
The second enqueue operation (ImplicitProducer::enqueue) inserts value 0 into a different instance (e.g., 0x0000007f2c0103a0).
The first try_dequeue operation selects the instance (0x0000007f2c0103a0) based on a "best" scoring mechanism and retrieves value 0.
The second try_dequeue operation selects the instance (0x0000007f28001920) based on the same mechanism and retrieves value 4.
Is there a solution to ensure that the dequeue order matches the enqueue order in this scenario?

We checked the code and appended the log and found

For data 0 and data 4, the bestSize calculation is 1, resulting in the wrong order of data when retrieving.