-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Ready] Fast Concurrent Deque Through Explicit Timestamping #127
base: integration
Are you sure you want to change the base?
Changes from 1 commit
9d2f2af
4e31819
fff2b21
c20d3c3
86ff17d
c7c96bf
9f6d53e
92efc84
a136c71
0dcef53
7fdf05c
ab723b5
b2a8b91
0178ecb
2bb8dce
06542ae
09052d7
546b8b3
0e4fd30
0181934
c4ecac4
eb5e9f6
a5ecc16
72f5ef0
ac02558
430297f
ff40ba7
5ee65b5
d5ece4c
2410e88
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#include <cds_test/ext_gtest.h> | ||
#include <cds/container/ts_deque.h> | ||
#include <cds/container/ts_timestamp.h> | ||
#include <cds/compiler/ts_hardwaretimestamp.h> | ||
|
||
namespace { | ||
|
||
|
@@ -81,26 +82,32 @@ namespace { | |
|
||
TEST_F( TSDeque, hardware_timestamping ) | ||
{ | ||
typedef cds::container::TSDeque<int, cds::container::HardwareTimestamp, | ||
cds::container::tsdeque::make_traits< | ||
cds::opt::item_counter< cds::atomicity::item_counter > | ||
>::type | ||
> deque_type; | ||
|
||
deque_type dq(1, 0); | ||
test( dq ); | ||
if (cds::tshardwaretimestamp::platform::has_rdtscp() == 1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You check rdtscp existence only in unit tests, but what should do developers who will use your API, the same? It should be transparent for users There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Проблема в том, что, как я понял, нет возможности проверить наличие rdtscp во время компиляции. Эту проверку необходимо делать во время выполнения программы. Я не знаю, как сделать это прозрачным для пользователей. Подскажите? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's possible to determine it through There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Не совсем понимаю, что вы имеете ввиду. У нас и так проверка наличия There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Всё верно, я сначала ответил на вопрос, а потом посмотрел реализацию |
||
{ | ||
typedef cds::container::TSDeque<int, cds::container::HardwareTimestamp, | ||
cds::container::tsdeque::make_traits< | ||
cds::opt::item_counter< cds::atomicity::item_counter > | ||
>::type | ||
> deque_type; | ||
|
||
deque_type dq(1, 0); | ||
test( dq ); | ||
} | ||
} | ||
|
||
TEST_F( TSDeque, hardware_interval_timestamping ) | ||
{ | ||
typedef cds::container::TSDeque<int, cds::container::HardwareIntervalTimestamp, | ||
cds::container::tsdeque::make_traits< | ||
cds::opt::item_counter< cds::atomicity::item_counter > | ||
>::type | ||
> deque_type; | ||
|
||
deque_type dq(1, 100000); | ||
test( dq ); | ||
if (cds::tshardwaretimestamp::platform::has_rdtscp() == 1) | ||
{ | ||
typedef cds::container::TSDeque<int, cds::container::HardwareIntervalTimestamp, | ||
cds::container::tsdeque::make_traits< | ||
cds::opt::item_counter< cds::atomicity::item_counter > | ||
>::type | ||
> deque_type; | ||
|
||
deque_type dq(1, 100000); | ||
test( dq ); | ||
} | ||
} | ||
|
||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's quit strange to have "has_..." function returning logically boolean value with int signature