Changeset 707c59c in ingen


Ignore:
Timestamp:
10/23/15 12:41:17 (2 years ago)
Author:
David Robillard <d@…>
Branches:
master, groups, nodeless, parallel, parameters, sequencefix
Children:
ae84d83
Parents:
626ec62
Message:

Speed up multi-deletion

Take only a fine-grained lock on the store for deletion. IIRC, the long
lock was to avoid conflict with Get which accesses the store in post_process(),
but this issue has been fixed and events only access the store in pre_process().
I believe it is now safe to only lock Delete during pre_process() as a result.

git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5771 a436a847-0d15-0410-975c-d299462d15a1

Location:
src/server/events
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/server/events/Delete.cpp

    r3353177 r707c59c  
    4646    , _compiled_graph(NULL) 
    4747    , _disconnect_event(NULL) 
    48     , _lock(engine.store()->mutex(), std::defer_lock) 
    4948{ 
    5049    if (Node::uri_is_path(uri)) { 
     
    8584    } 
    8685 
    87     _lock.lock(); 
     86    // Take a writer lock while we modify the store 
     87    std::unique_lock<std::mutex> lock(_engine.store()->mutex()); 
    8888 
    8989    _engine.store()->remove(iter, _removed_objects); 
     
    146146Delete::post_process() 
    147147{ 
    148     if (_lock.owns_lock()) { 
    149         _lock.unlock(); 
    150     } 
    151  
    152148    _removed_bindings.reset(); 
    153149 
  • src/server/events/Delete.hpp

    r3353177 r707c59c  
    8282    SPtr<ControlBindings::Bindings> _removed_bindings; 
    8383    Store::Objects                  _removed_objects; 
    84  
    85     std::unique_lock<std::mutex> _lock; 
    8684}; 
    8785 
Note: See TracChangeset for help on using the changeset viewer.