Skip to content
Snippets Groups Projects
  • Nadav Har'El's avatar
    cb41801a
    lockfree::mutex functions should not be inline · cb41801a
    Nadav Har'El authored
    Until now, lockfree::mutex functions were entirely inline, which won't
    fly if we want to make it our default mutex. Change them to be out-of-line,
    implemented in a new source file core/lfmutex.cc.
    
    This has a slight performance impact - uncontended lock/unlock pair used
    to be 17ns, and is now 22ns.
    
    In the future we can get this performance back by making these functions
    partially inline (the uncontended case inline, the waiting case in a
    separate function), although we'll need to consider the speed/code-size
    tradeoff.
    cb41801a
    History
    lockfree::mutex functions should not be inline
    Nadav Har'El authored
    Until now, lockfree::mutex functions were entirely inline, which won't
    fly if we want to make it our default mutex. Change them to be out-of-line,
    implemented in a new source file core/lfmutex.cc.
    
    This has a slight performance impact - uncontended lock/unlock pair used
    to be 17ns, and is now 22ns.
    
    In the future we can get this performance back by making these functions
    partially inline (the uncontended case inline, the waiting case in a
    separate function), although we'll need to consider the speed/code-size
    tradeoff.