58 Commits
Author SHA1 Message Date
Patrick Pelissier 475836e851 Use of new macro M_CACHELINE_ALIGN 2019-01-15 19:11:10 +01:00
Patrick Pelissier 8b3a4a802c Happy new year! 2019-01-02 18:12:07 +01:00
Patrick Pelissier 2e3b312fab Fix issue of recursive usage of M_GLOBAL_OPLIST_OR_DEF
Update the way to use the macro to avoid being limited by the
preprocessor limitation.
2018-09-14 20:57:55 +02:00
Patrick Pelissier 60478e3f61 Port to M_CALL for M-SNAPSHOT 2018-09-10 21:55:18 +02:00
Patrick Pelissier 3b0e940284 Add missing _ptr & _srcptr alias. 2018-08-19 17:58:23 +02:00
Patrick Pelissier 143a5fdf4f Fix issue if given type is a T * = TYPE:
token pasting created const T *, which is not the same as
const TYPE = T * const
2018-08-03 20:20:57 +02:00
Patrick Pelissier 68c737dcef Clean up interface if (internal) genint:
it returns at most an 2048, so an unsigned int is more enought
(and internally it was already used!).
So transform the interface to take as input unsigned int.

Fix maximum size supported by the genint package.

Add proper constant used for error, and use it in the code.
2018-08-02 23:19:05 +02:00
Patrick Pelissier 7d2494b7f9 Fix bug of SPMC / MPMC snapshots: not all items in buffers
were properly cleared.
2018-07-17 21:10:14 +02:00
Patrick Pelissier 3b642ffeb3 Update after internal review. 2018-07-17 21:00:55 +02:00
Patrick Pelissier 96202aa78f Do not use reserved identifiers of the C standard (See 7.1.3 Reserved identifiers) 2018-07-14 14:35:14 +02:00
Patrick Pelissier 522632bea6 Remove deprecated macro SNAPSHOT_DEF.
Shall use SNAPSHOT_SPSC_DEF
2018-06-27 20:04:18 +02:00
Patrick Pelissier 25e8c9f637 Update comments. 2018-06-02 19:23:46 +02:00
Patrick Pelissier 704fb0cbd9 Add a cast to avoid a warning with some compilers
(I am not sure the warning was justified).
2018-04-19 22:13:53 +02:00
Patrick Pelissier c174b368e8 Fix issue with atomic variables needing writable variable even for reading only. 2018-03-16 23:27:08 +01:00
Patrick Pelissier f2b2335080 Fix issue with C++ not supporting passing an int constant value to an unsigned atomic type...
I definitely find this disturbing.
2018-03-16 22:59:51 +01:00
Patrick Pelissier f8e75761ef Change SNAPSHOT_SRSW to SNAPSHOT_SPSC to be uniform with queue definition
(Replace Reader / Writer term by Consummer / Producer term)
2018-03-10 17:46:02 +01:00
Patrick Pelissier aea816dcaf Fix data race 2018-02-24 07:44:16 +01:00
Patrick Pelissier b442d72ef7 Add forgotten free + check for memory allocation 2018-02-19 23:14:16 +01:00
Patrick Pelissier b32b93340c Improve tests & fix bugs.
Still one bug remain.
2018-02-18 17:01:41 +01:00
Patrick Pelissier 6de4c4092f Add MRMW snapshot 2018-02-18 08:27:10 +01:00
Patrick Pelissier 3f2a641cdf Add contract 2018-02-17 20:25:40 +01:00
Patrick Pelissier 20be2d8850 Externalized currentWrite 2018-02-17 20:21:53 +01:00
Patrick Pelissier b37cd7dba7 Rewrite / simplify code 2018-02-17 20:08:00 +01:00
Patrick Pelissier e274a49ffd Fix bug as we can't fail spuriously here. 2018-02-17 19:28:09 +01:00
Patrick Pelissier cba37abfae Reword 2018-02-17 19:24:16 +01:00
Patrick Pelissier be198a7040 Add MRSW snapshots. 2018-02-17 19:19:51 +01:00
Patrick Pelissier a4753be5ae Add test for int snapshot MRSW 2018-02-17 18:20:25 +01:00
Patrick Pelissier 3bda360196 Add first step of MRSW snapshot 2018-02-17 17:35:18 +01:00
Patrick Pelissier 80c7cdbdd2 Rename snapshot_def as snapshot_srsw_def 2018-02-17 12:00:45 +01:00
Patrick Pelissier 0afad9a825 Update comments. 2018-02-15 22:34:36 +01:00
Patrick Pelissier c99b3de902 Fix double minus which transformed into + ! 2018-02-15 22:31:50 +01:00
Patrick Pelissier 67856a98af Avoid false sharing for snapshot by aligning properly the
data of the triple buffer to a cache boundary.
2018-02-10 08:29:34 +01:00
Patrick Pelissier c71de15cb0 Update comment 2018-02-10 08:22:37 +01:00
Patrick Pelissier 73f15c1980 Update comment 2018-02-10 08:22:12 +01:00
Patrick Pelissier 210e05f7fc Update copyright to 2018 2018-01-29 20:28:30 +01:00
Patrick Pelissier 2c695526dd Fix issue with stricter C++ compiler with atomic definition.
(It still feels strange to not be able to store 0 in an atomic unsigned long).
2017-12-30 12:17:55 +01:00
Patrick Pelissier 229f99585d Rename _look ==> _read and _take ==> _write 2017-10-15 22:49:59 +02:00
Patrick Pelissier 2700ccba1a [SNAPSHOT]:
* Rename functions get_produced / get_consummed into get_write_buffer and get_read_buffer

* Add function _updated_p

* Add comments.
2017-10-11 22:16:39 +02:00
Patrick Pelissier 9cea3cf74d Fix issue with definition of oplist of a snapshot 2017-10-10 23:06:33 +02:00
Patrick Pelissier 2e564088b0 Simplify the inclusion of headers. 2017-09-16 10:14:45 +02:00
Patrick Pelissier 1930bdeac1 _DEF macros checks if a global oplist is register if there is no one
given in the macro call. If it founds one, it will be it instead
of M_DEFAULT_OPLIST.
2017-09-16 08:31:22 +02:00
Patrick Pelissier 82b159e097 Add TODO 2017-08-19 12:19:30 +02:00
Patrick Pelissier 8a716cd4f4 Remove prefix snapshot from snapshot.
See previous commit on shared pointer.
2017-07-25 22:44:17 +02:00
Patrick Pelissier 62e2024658 Rename type into name for oplist definition. 2017-07-25 22:37:51 +02:00
Patrick Pelissier ba7c772ae2 Use of M_CONST_CAST. 2017-05-26 15:49:23 +02:00
Patrick Pelissier 72c5c3f371 Replace stdatomic.h (C11 standard compliant header) by a custom one
to increase C++ compatibility as stdatomic.h doesn't work in C++!

(I would like to thanks the one(s) who thought it was a good idea
***not*** to include stdatomic.h -and thread.h- in the C++ standard!)
2017-04-13 21:50:16 +02:00
Patrick Pelissier 3db02c64fa Fix issue with even stricter atomic implementation
(without even the set operator for atomics).
2017-04-10 23:04:34 +02:00
Patrick Pelissier 06b3f49855 Add missing const cast 2017-04-08 12:03:12 +02:00
Patrick Pelissier 4c75569a20 Fix issue with stricter compiler with stdatomic. 2017-04-08 11:51:18 +02:00
Patrick Pelissier 7d6f1861c9 Remove use of atomic_uint_fast8_t:
this type may not be available on all targets.
Use plain atomic_uchar instead.

Use of atomic_load to read an atomic_uchar.

Remove const from prototype since atomic_load
doesn't support const pointers.
2017-04-08 11:21:30 +02:00