NOTE: This feature is only available in the extended version of MentaLog
MentaLog uses MentaAffinity to bind (or pin) the producer thread (the one doing the logging) and the consumer thread (the one doing the writing) to isolated cpu cores. By doing that, latency is kept to a minimum as there are no thread interrupts and context switches. Also because the thread never leaves the cpu core, they can take better advantage of the L1 cache to make things even faster.
The consumer thread is created and controlled by MentaLog so that the actual system calls to write the bytes to the file (or to the mapped byte buffer if you are using memory-mapped files) are done asynchronously, without introducing latency in you main application thread (the producer). To assign the consumer thread to a cpu core all you have to do is use the -DlogProcToBindConsumer startup option or the Log.setProcToBindConsumer(int x) method, passing the cpu core number you have previously isolated. Refer to the MentaAffinity site for more information on how to do this correctly as some OS options need to be configured.
NOTE: MentaAffinity requires Linux with JNA installed. If none of this requirements are met, thread pinning does not happen and a warning message is printed to syserr.
The producer thread will most likely be your main application thread doing the logging. Because you are the one creating and controlling this thread, you must use MentaAffinity to bind this thread yourself to whatever cpu core you have isolated. Of course you do not want to bind this thread to the same cpu core you have bound the consumer thread. Fortunately it is very easy to use MentaAffinity. Just refer to its site for more information.