1
Can you please point me to a tutorial for an explanation of the specific "Critical section" implementation that is used in main.cpp. I would like to understand a bit better how does it work. I studied concurrency before so I have some background to be able to understand it.
It is more clear now. But is CCriticalSection class related to CRITICAL_BLOCK? Also, what does the cs mean in cs_mapKeys? – user1769523 – 2014-08-24T22:00:37.277
@user1759523: I don't know what CRITICAL_BLOCK is and I see no reference to it in the Bitcoin source. cs is just part of the name of the variable ´cs_mapKeys´ but I assume it is supposed to remind you that it is an object of type CCriticalSection. – Nate Eldredge – 2014-08-24T22:05:25.077
Maybe it was only in previous versions. See: https://github.com/bitcoin/bitcoin/blob/4405b78d6059e536c36974088a8ed4d9f0f29898/main.cpp
– user1769523 – 2014-08-24T22:41:07.680@user1759523: It looks like this has been replaced by LOCK. But anyway, you can see the code in sync.h; I'm not sure what you want to know specifically. These might be better questions for Stack Overflow since they are more about C++ in general than Bitcoin in particular. – Nate Eldredge – 2014-08-24T23:53:59.813