From: Guus Sliepen Date: Fri, 14 Jan 2011 21:18:59 +0000 (+0100) Subject: Introducing the Big Tinc Lock. X-Git-Url: https://www.tinc-vpn.org/git/browse?a=commitdiff_plain;h=6834b882015a9323672e9fce8811aa4283f196f0;hp=6834b882015a9323672e9fce8811aa4283f196f0;p=tinc Introducing the Big Tinc Lock. Now that tinc is multi-threaded, we need some form of synchronisation. For now, there is a single mutex which we lock whenever we do something with global data structures. The main thread, from which timer events are handled, is always locked unless it is sleeping for the next event, the other threads receive incoming I/O unlocked, and lock to process the received data. In the future more fine-grained locking should be used, probably in the form of rwlocks, or lockless algorithms (maybe RCU). ---