smb374 / my-async-rs

An example async runtime.
MIT License
0 stars 0 forks source link

Design the structure of the priority queue #1

Open smb374 opened 2 years ago

smb374 commented 2 years ago
smb374 commented 2 years ago

From garro95/priority-queue:

smb374 commented 2 years ago

~Another simple way is to wrap the current PriorityQueue with AtomicCell from crossbeam and enclose it with Pool. May try this out first before we start to implement.~ Doesn't work very well because AtomicCell requires T: Copy to use load & using fetch_update doesn't increase performance.

smb374 commented 2 years ago

~Third option is use locks. Mutex from parking_lot have fair unlock which may achieve the same performance compare to the lock-free solution.~ Provide a worse performance in terms of throughput & transaction rate.

smb374 commented 2 years ago

Currently implemented the HybridScheduler for a eclectic solution