Comments (3)
Sorry for the delay, I accidentally broke all incoming traffic (including emails, like those from GitHub) to my server :-{
There's two reasons. First, std::this_thread::get_id()
is very slow on certain key platforms, like Windows (orders of magnitude slower than calling GetCurrentThreadId()
). Second, the type of the object returned is implementation defined. I need a thread ID that I can use inside a special-purpose lock-free hash internally, and for that I need some sort of numeric/pointer type with a defined maximum size.
Also, ideally I need two invalid thread ID values; std::thread_id
has just one. This is currently only used in code that is disabled (because it causes problems for some people), but eventually I'd like to enable that code, and for that I need a second invalid thread ID.
I only use std::thread_id
on iOS because there's no better way to get a thread ID, and even then it's reinterpreted as a numeric type (this relies on platform-specific implementation details, but is better than not having support for iOS at all, and these details are at least unlikely to change).
from concurrentqueue.
Thanks for the reply. I was just curious.
On Wed, 30 Mar 2016 at 16:28 Cameron [email protected] wrote:
Sorry for the delay, I accidentally broke all incoming traffic (including
emails, like those from GitHub) to my server :-{There's two reasons. First, std::thread::this_thread::get_id() is very
slow on certain key platforms, like Windows (orders of magnitude slower
than calling GetCurrentThreadId()). Second, the type of the object
returned is implementation defined. I need a thread ID that I can use
inside a special-purpose lock-free hash internally, and for that I need
some sort of numeric/pointer type with a defined maximum size.I only use std::thread_id on iOS because there's no better way to get a
thread ID, and even then it's reinterpreted as a numeric type (this relies
on platform-specific implementation details, but is better than not having
support for iOS at all, and these details are at least unlikely to change).—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#43 (comment)
from concurrentqueue.
No problem :-)
from concurrentqueue.
Related Issues (20)
- Memory Leak HOT 6
- [feature-request] Associating ProducerToken & ConsumerToken explicitly
- segment fault
- Occasionally program can be stuck inside try_dequeue of blockingconcurrentqueue.h HOT 1
- installed concurrentqueue using vcpkg, but can not make.
- try_dequeue_bulk core dump. HOT 2
- Introducing LIFO semaphore
- Waiting without dequeuing HOT 1
- ConcurrentQueue ~150x slower on Windows HOT 11
- Naming conflict HOT 2
- About license HOT 1
- Weird dequeue behavior HOT 8
- Linux fs.h causes compilation problems HOT 4
- To use one concurrent queue between multiple threads HOT 3
- GLIBC version requires 2.30, but deploy platform has 2.29 only
- try_enqueue takes up to 1024 elements, regardless of initial capacity HOT 4
- wait_dequeue occasionally not working properly HOT 5
- q.try_dequeue(...) Get exception EXC_BAD_ACCESS (code=1, address=0x0) HOT 1
- Dequeue a list using an std::vector HOT 1
- How to use Concurrent queue with std::vector HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from concurrentqueue.