commit | 87d54a9a6dee5170c7c12e1bd3f43bd9f49634e7 | [log] [tgz] |
---|---|---|
author | Willy Tarreau <w@1wt.eu> | Mon Oct 15 09:44:46 2018 +0200 |
committer | Willy Tarreau <w@1wt.eu> | Mon Oct 15 13:25:06 2018 +0200 |
tree | b2b8bb6ec26cde5946aca0e366b73422228a6a0d | |
parent | 9504dd64c6a92de1c20f6a53fb25c4e27ba6683d [diff] |
MEDIUM: fd/threads: only grab the fd's lock if the FD has more than one thread The vast majority of FDs are only seen by one thread. Currently the lock on FDs costs a lot because it's touched often, though there should be very little contention. This patch ensures that the lock is only grabbed if the FD is shared by more than one thread, since otherwise the situation is safe. Doing so resulted in a 15% performance boost on a 12-threads test.