hooku

Please enjoy some eccentric technologies.

C++ Notes

CPP

Concurrency

Presenter: [email protected]

Mutex

  • Be as constant as possible, be as local as possible

  • Bad

    m.lock();	
    sharedVariable = getVar();
    m.unlock();
    
  • Good

    auto res = getVar();
    m.lock();
    sharedVariable = getVar();
    m.unlock();
    
  • NNN=No Naked New

  • NNM=No Naked Mutex