<commit_before># HighQueue
A Queue for High Speed message passing between threads, processes, or other components.

<pre>
  The HighQueue Haiku

  To send messages
  So quickly you must use a
  Good algorithm.
</pre>

##Introduction
A High Performance Queue (HighQueue) is a mechanism for message passing between components of a system.  It is most often used to pass messages between two or more threads in the same process, but it can also be used for intra-process communication by putting the HighQueue in shared memory. 
###Clients
HighQueue clients can be either a Publisher or a Consumer.
  *	Producers create and publish data into the HighQueue.   
  * Consumers accept and process data from the HighQueue.
  
Each HighQueue instance supports multiple Producers, but only a single Consumer.
##Client API
The HighQueue API consists of the public interfaces of four primary classes:   Message, Connection, Consumer, and Producer.  Two additional classes, CreationParameters and ConsumerWaitStrategy are used to initialize the HighQueue.
###Start with a Connection
A Connection provides access to a HighQueue.  A Connection may be used to create an initialize a new HighQueue, or it may be used to attach to an existing HighQueue (presumably in shared memory.)  Once the HighQueue is created or located, the Connection can be used to initialize Producer and Consumer clients.

####Step-by-step:
  *	Construct a Connection object.  No construction arguments are required.
  *	If the Connection will be used to create a new HighQueue:
    *	Construct a ConsumerWaitStrategy which specifies how Consumers wait for messages<commit_msg>Mention performance numbers in the documentation.<commit_after># HighQueue
A Queue for High Speed message passing between threads, processes, or other components.

<pre>
  The HighQueue Haiku

  To send messages
  So quickly you must use a
  Good algorithm.
</pre>

##Introduction
A High Performance Queue (HighQueue) is a mechanism for message passing between components of a system.  It is most often used to pass messages between two or more threads in the same process, but it can also be used for intra-process communication by putting the HighQueue in shared memory. 

###Clients
HighQueue clients can be either a Publisher or a Consumer.
  *	Producers create and publish data into the HighQueue.   
  * Consumers accept and process data from the HighQueue.
  
Each HighQueue instance supports multiple Producers, but only a single Consumer.

##How fast is it?
Absolute performance numbers are notoriously difficult to measure accurately. The results vary widely from machine to machine.

That being said, tests on an Intel(R) Core(TM) i7-4790 CPU @3.60GHz [8 cores] with one producer and one consumer
show sustained throughput is around 18 million messages/second.  This translates to between 50 and 60 nanoseconds 
per message delivery.  It can sustain this rate up to 6 producers and one consumer.  Beyond that the threads start
competing with the operating system (Win7) and with each other for the available cores and throughput starts to drop.
[With 8 producers + 1 consumer + Windows a message is delivered to the consumer thread every 145 nanoseconds.]

You can generate equivalent numbers for your machine by running the MultithreadPerformanceTest which is included in the HQPerformance executable.

<em>Your Mileage Will Vary!</em>

##Client API
The HighQueue API consists of the public interfaces of four primary classes:   Message, Connection, Consumer, and Producer.  Two additional classes, CreationParameters and ConsumerWaitStrategy are used to initialize the HighQueue.
###Start with a Connection
A Connection provides access to a HighQueue.  A Connection may be used to create an initialize a new HighQueue, or it may be used to attach to an existing HighQueue (presumably in shared memory.)  Once the HighQueue is created or located, the Connection can be used to initialize Producer and Consumer clients.

####Step-by-step:
  *	Construct a Connection object.  No construction arguments are required.
  *	If the Connection will be used to create a new HighQueue:
    *	Construct a ConsumerWaitStrategy which specifies how Consumers wait for messages
{'fraction_non_alphanumeric': 0.03824228028503563, 'fraction_numerical': 0.005225653206650831, 'mean_word_length': 4.526246719160105, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2511372', 'n_tokens_mistral': 1029, 'n_tokens_neox': 966, 'n_words': 613}