Are you looking for progammers to tell you how the code is written? Or are you looking for suggestions of software that you are willing to look at the code and see for yourself?
I can't tell you how the code is written, but maybe a suggestion or two if you want to look. Someone else might toss in some other suggestions, or you could just hop over to gnu.org or sourceforge and browse through looking for likely descriptions.
mon might be a not too complex piece of code to look at. Amanda might be a bit more involved. Both orchestrate multiple processes & events. Both are unix/linux applications, not windows. Of course, there are much more complex creatures to look at, such as apache or sendmail. And, if you google multithreaded locks, you'll see lots of guides, commentary and tutorial type stuff.
So, more detail on what you want might bring more useful help.