The alignment will only be calculated for hits with a certain cutoff. Hence there are more searches than alignments. Depending on this ratio, the number of started or running alignment threads can be adjusted dynamically or given as a command line parameter.
On idea to further parallelize swipe is to use a lock-free multi-producer/single-consumer (MPSC) or multi-producer/multi-consumer (MPMC) FIFO queue (i. e. https://software.intel.com/en-us/blogs/2009/08/11/multi-producermulti-consumer-seh-based-queue) for the hit_list and let run one ore more alignment threads in parallel to the search threads.
The alignment will only be calculated for hits with a certain cutoff. Hence there are more searches than alignments. Depending on this ratio, the number of started or running alignment threads can be adjusted dynamically or given as a command line parameter.