Skip to content

Feat support win64 (vcpkg+CMake) for rocksdb#8

Closed
kabu1204 wants to merge 7 commits into
ls4154:masterfrom
kabu1204:feat-support-win64
Closed

Feat support win64 (vcpkg+CMake) for rocksdb#8
kabu1204 wants to merge 7 commits into
ls4154:masterfrom
kabu1204:feat-support-win64

Conversation

@kabu1204
Copy link
Copy Markdown
Contributor

YCSB-cpp can now be built on windows, using vcpkg and CMake.
See README.md for usage.

kabu1204 and others added 7 commits February 13, 2023 11:02
e.g. len(k), len(v) = 8B, 24B:
-p fixedkey8b=true
-p fixedfieldlen=true
-p fieldcount=1
-p fieldlength=24
YCSB-cpp can now be built on windows, using vcpkg and CMake.
See README.md for usage.
@kabu1204
Copy link
Copy Markdown
Contributor Author

The PR is not intended to merge into this repo. Sorry for the missing. I'll close the PR.

@kabu1204 kabu1204 closed this Feb 24, 2023
@ls4154
Copy link
Copy Markdown
Owner

ls4154 commented Feb 24, 2023

Looks great. :)

@kabu1204
Copy link
Copy Markdown
Contributor Author

Looks great. :)

Thanks.
There's a strange problem. I've just tested with recordcount=100M and threadcount=8 on windows, the StatusThread may randomly exit early(done=true), even though all ClientThreads are still running (the latch->count_ is still 8). The exiting timing varies, maybe at 9s, 30s or several minutes. The ClientThreads will keep running to the end normally.

Yes, I observed 9 sec while the interval is set to 10s. I've not encountered this situation on Linux before, which makes me doubt the precision and resolution of std::chrono on windows.

I tried this change:

// countdown_latch.h:26
return cv_.wait_for(lock, std::chrono::seconds(timeout_sec), [this]{return count_ <= 0;});
// return cv_.wait_for(lock, std::chrono::seconds(timeout_sec)) == std::cv_status::no_timeout;

I run the test another 5 times and the problem didn't appear. I cannot explain why.

Is this a coincide? Am I missing something?

@ls4154
Copy link
Copy Markdown
Owner

ls4154 commented Feb 25, 2023

CV is notified only when all ClientThread are terminated, so I think StatusThread should not wake up for reason other than timeout. Still, it might be safe to check the count after wake up.

@kabu1204
Copy link
Copy Markdown
Contributor Author

CV is notified only when all ClientThread are terminated, so I think StatusThread should not wake up for reason other than timeout. Still, it might be safe to check the count after wake up.

You're right. We need to check the count on windows.
After a boring search, I found the reason:
https://devblogs.microsoft.com/oldnewthing/20180201-00/?p=97946

and from cplusplus/wait_for :

Generally, the function is notified to wake up by a call in another thread either to member notify_one or to member notify_all. But certain implementations may produce spurious wake-up calls without any of these functions being called. Therefore, users of this function shall ensure their condition for resumption is met.

If pred is specified (2), the function only blocks if pred returns false, and notifications can only unblock the thread when it becomes true (which is especially useful to check against spurious wake-up calls).

@ls4154
Copy link
Copy Markdown
Owner

ls4154 commented Feb 25, 2023

Thanks! I didn't know that since I've never tested it in a Windows environment. I'll fix it soon, or please feel free to submit PR.

@kabu1204
Copy link
Copy Markdown
Contributor Author

Thanks! I didn't know that since I've never tested it in a Windows environment. I'll fix it soon, or please feel free to submit PR.

OK. I've run heavy tests(1G record count and 100M opcount) with rocksdb on windows all day today. It seems there's no problem.
I plan to add support for wiredtiger on windows, along with lmdb and leveldb, before making a PR to this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants