Skip to content

A fast no_lock RingQueue between 2 threads (25M WrtieRead per second)

Notifications You must be signed in to change notification settings

Walterkd/fast_ring_queue

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1. What is a ring queue


  • the data is "first in first out".
  • prev data of queue head is the queue tail.
  • the data of ring can reuse.

2. The advantages of ring queue


  • Guaranteed elements are first-in, first-out

  • Element space can be reused

  • Provides an efficient mechanism for multithread data transfer.

3. Ring queue of work example


  • Linux between kernel and system to transfor network data( PACKET_RX_RING and PACKET_TX_RING )

4. Actual test results


  • In CentOS 5.5 (cpu per core frequency 1200MHz) .
  • ring queue length is 10000, one element data size is 4 bytes
  • [ring_test] the element writted and then to read is about 25 million per second.
  • [notify_ring_test] the element writted and then to read is about 20 million per second.

About

A fast no_lock RingQueue between 2 threads (25M WrtieRead per second)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 60.9%
  • C++ 36.2%
  • Makefile 2.9%