base,sim: implement a faster mutex for single thread case
This change applies an atomic variable to check if we really need to obtain a mutex, and uses a condition variable to notify. See about 5% improvement in the simulation speed. Change-Id: I7e165987dcb587b27fae90978b9b3fde6f5563ef Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34915 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Richard Cooper <richard.cooper@arm.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Gabe Black <gabeblack@google.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -73,6 +73,7 @@ Source('trace.cc')
|
||||
GTest('trie.test', 'trie.test.cc')
|
||||
Source('types.cc')
|
||||
GTest('types.test', 'types.test.cc', 'types.cc')
|
||||
GTest('uncontended_mutex.test', 'uncontended_mutex.test.cc')
|
||||
|
||||
Source('stats/group.cc')
|
||||
Source('stats/text.cc')
|
||||
|
||||
Reference in New Issue
Block a user