Matt Kline
ffccd6ddd2
Use atomics to count shared_object without locks
...
C++11 (and subsequent C++ standards) provide portable ways to issue
atomic hardware instructions, which allow multiple threads to load,
store, and modify integers without taking a lock. The standard also
defines a memory model that lets you express the ordering guarantees
around these atomic operations. (x86 is relatively strongly-ordered, but
many other common architectures, such as ARM, are free to reorder loads
and stores unless told not to.)
This patch removes the lock from shared_object and replaces it with the
standard thread-safe reference counting implementation used in
C++'s std::shared_ptr, Rust's std::sync::Arc, and many others.
Additional resources on the topic:
https://assets.bitbashing.io/papers/concurrency-primer.pdf
https://www.youtube.com/watch?v=ZQFzMfHIxng
2018-04-25 12:50:44 +02:00
..
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-11-15 01:57:14 -05:00
2016-09-04 00:13:45 +00:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-05-12 18:26:42 +02:00
2017-08-04 07:19:39 +09:00
2017-06-12 13:57:08 -04:00
2017-05-12 18:26:42 +02:00
2017-05-12 18:26:42 +02:00
2017-12-20 14:16:16 +09:00
2017-02-06 02:41:15 +02:00
2018-03-09 23:03:19 -08:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-08-01 00:39:00 -04:00
2017-10-03 00:47:45 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2018-03-28 00:03:10 -07:00
2018-03-20 00:43:15 -07:00
2017-02-06 02:41:15 +02:00
2017-10-24 17:42:30 +02:00
2017-11-19 10:50:22 +09:00
2017-07-27 17:26:13 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-11-22 16:36:51 +01:00
2017-02-06 02:41:15 +02:00
2017-07-27 17:26:13 +02:00
2017-12-09 07:55:30 +00:00
2017-09-26 20:33:09 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2018-03-10 16:08:21 -08:00
2017-11-25 12:36:34 +01:00
2018-04-17 09:17:33 +02:00
2017-02-06 02:41:15 +02:00
2018-04-24 11:25:49 +03:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-11-08 20:47:22 -05:00
2017-12-11 10:46:19 -05:00
2017-02-06 02:41:15 +02:00
2015-04-27 13:04:26 +03:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-03-08 17:09:57 +01:00
2017-02-06 02:41:15 +02:00
2018-04-24 11:25:49 +03:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-03-26 22:06:43 +02:00
2017-02-06 02:41:15 +02:00
2017-03-16 11:35:18 +00:00
2017-08-12 10:16:34 +09:00
2017-02-06 02:41:15 +02:00
2017-11-22 16:36:51 +01:00
2017-09-14 08:09:54 +09:00
2017-08-04 07:19:39 +09:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2018-03-09 11:41:17 -05:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-07-07 18:52:41 +02:00
2018-04-20 19:01:11 -07:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-06-26 19:45:59 +02:00
2018-04-17 09:17:33 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-03-16 11:35:18 +00:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-08-16 01:46:17 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-09-18 21:48:33 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2008-07-22 11:36:50 +00:00
2018-04-15 21:38:37 -04:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2018-04-15 21:38:37 -04:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-11-22 13:49:57 +01:00
2017-02-06 02:41:15 +02:00
2017-11-24 09:56:08 +09:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-11-13 08:52:08 +09:00
2017-12-26 00:33:11 +01:00
2017-09-26 20:33:09 +02:00
2017-10-18 17:02:40 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-11-22 20:38:10 +01:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-11-17 09:51:56 -05:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-03-20 06:14:18 +00:00
2017-07-20 18:23:10 +02:00
2017-02-06 02:41:15 +02:00
2018-03-02 13:28:56 +09:00
2017-11-22 20:38:10 +01:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-10-18 14:41:00 +02:00
2018-03-15 18:46:55 -07:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-08-04 07:19:39 +09:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-07-26 20:39:50 +02:00
2017-03-16 11:35:18 +00:00
2018-04-03 13:37:25 +02:00
2017-02-06 02:41:15 +02:00
2017-03-13 01:14:42 +01:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-11-22 11:08:47 +01:00
2017-02-06 02:41:15 +02:00
2017-11-15 00:08:48 -05:00
2017-10-18 17:02:40 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2018-03-07 23:54:28 +09:00
2017-02-06 02:41:15 +02:00
2018-03-07 23:54:28 +09:00
2017-02-06 02:41:15 +02:00
2018-03-15 18:46:55 -07:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-08-27 12:23:08 +02:00
2017-03-16 11:35:18 +00:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-06-08 12:31:53 +02:00
2014-08-14 17:34:49 +02:00
2017-02-06 02:41:15 +02:00
2017-11-06 11:17:10 +01:00
2018-04-25 12:50:44 +02:00
2017-02-06 02:41:15 +02:00
2017-11-15 00:08:48 -05:00
2017-12-26 00:33:11 +01:00
2017-09-12 21:57:40 +02:00
2018-03-11 09:07:00 -07:00
2017-02-06 02:41:15 +02:00
2017-11-15 00:15:01 -05:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-05-31 16:19:58 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-11-14 23:42:26 -05:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-11-01 14:43:39 -04:00
2017-05-07 13:05:19 +02:00
2017-10-16 15:51:21 +02:00
2017-07-08 19:42:13 -03:00
2017-07-08 19:42:13 -03:00
2017-02-06 02:41:15 +02:00
2017-03-16 11:35:18 +00:00
2017-02-06 02:41:15 +02:00
2017-11-22 13:54:19 +01:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00
2017-02-06 02:41:15 +02:00