projects:hpx:start
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
projects:hpx:start [2020/05/29 00:05] – agaev | projects:hpx:start [2020/06/01 18:04] – agaev | ||
---|---|---|---|
Line 62: | Line 62: | ||
Дополнительные вещи, не из стандарта: | Дополнительные вещи, не из стандарта: | ||
+ | |||
hazptr_array< | hazptr_array< | ||
+ | |||
hazptr_local< | hazptr_local< | ||
Line 95: | Line 97: | ||
... | ... | ||
} | } | ||
+ | | ||
+ | class hazard_pointer { | ||
+ | public: | ||
+ | ... | ||
+ | bool empty() const noexcept; | ||
+ | template < | ||
+ | template < | ||
+ | template < | ||
+ | void reset_protection(nullptr_t = nullptr) noexcept; | ||
+ | void swap(hazard_pointer& | ||
- | Аргумент против standard proposal: [[https:// | + | ====== |
+ | [[https:// | ||
В стандарте сейчас используется что-то похожее на base_hook | В стандарте сейчас используется что-то похожее на base_hook | ||
- | В Boost.Intrusive говорится: | + | |
- | Sometimes an ' | + | В Boost.Intrusive говорится(И это и есть аргумент): |
+ | Sometimes an ' | ||
+ | In this case, using a member hook as a data member instead of ' | ||
А потом ещё и | А потом ещё и | ||
- | A programmer might find that base or member hooks are not flexible enough in some situations. In some applications it would be optimal to put a hook deep inside a member of a class or just outside the class. Boost.Intrusive has an easy option to allow such cases: function_hook. | + | A programmer might find that base or member hooks are not flexible enough in some situations. |
+ | In some applications it would be optimal to put a hook deep inside a member of a class or just outside the class. | ||
+ | Boost.Intrusive has an easy option to allow such cases: function_hook. | ||
+ | |||
+ | ===== Как можно исправить ===== | ||
И кажется, | И кажется, | ||
Line 130: | Line 150: | ||
}; | }; | ||
- | My version: | + | My version(hook -> hazptr): |
//This functor converts between value_type and a hazptr_type | //This functor converts between value_type and a hazptr_type | ||
struct Functor | struct Functor | ||
Line 151: | Line 171: | ||
Кажется бесполезное преимущество, | Кажется бесполезное преимущество, | ||
+ | |||
+ | В массиве HP в libcds хранится каст к void*. В proposal' | ||
+ | |||
+ | Моя идея в том, чтобы как и в Boost.Intrusive, | ||
+ | |||
+ | ===== Почему их hazptr_obj_base -- плохо? ===== | ||
+ | |||
+ | Как говорится в Boost.Intrusive: | ||
+ | |||
+ | Мои варианты: | ||
+ | Function hook решает эту проблему. | ||
+ | |||
+ | ===== Альтернативные варианты ==== | ||
+ | |||
+ | Наша задача, | ||
+ | |||
+ | В protect мы кладём какой-то указатель, | ||
+ | |||
+ | Сейчас это isDefendedBy == isSame для libcds, и static_cast< | ||
+ | |||
+ | Это позволит делать улучшенную логику. К примеру, |
projects/hpx/start.txt · Last modified: 2020/06/08 10:30 by agaev