You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I like everything )) different approaches to understand and then choose the one that makes more sense to me and fits the requirements, it's simple.
The whole world works with DLL, with the miracles of ICL only a group of sectarians who think it is the highest competence.
That's hilarious, and I couldn't agree more ))))
Well gone to read the manuals and think about the options on offer.
Thanks to all who really do not flub, suggested various solutions.
Now there is much to choose from.
I understand correctly that Futures and Async are standard only for C++ ?
Isn't there a similar library in C ?
I understand correctly that Futures and Async are standard only for C++ ?
Isn't there a similar library in C ?
Right. Cish std also has multi-threading support https://en.cppreference.com/w/c/thread
ZS: you could also read the book "c++ concurrency in action" by anthony williams. For example, in chapter 9 he writes thread pool.
Right. Cish std also has multi-threading support https://en.cppreference.com/w/c/thread
HH: you could also read the book "c++ concurrency in action" by anthony williams. For example, in chapter 9 he writes thread pool.
Didn't notice the See also link at the bottom of the page ))
Got it,std::thread is in C, butstd::async is not ((
Just reading this book now )) Parallel C++ programming in action, Anthony Williams.
The book is in the attachment, async starts at chapter 4, pretty easy to read.
And Kurt Ganteroth, in his book Optimizing C++ Programs, claims that it's 14 times more expensive to create threads than to use std::async.
That's why I originally wanted to use async, but I didn't know much about threads in C/C++ either,
so ifthreads are more expensive, they fall off for use anyway.
But it turns out that in C,std::async does not exist((
Didn't notice the See also link at the bottom of the page ))
Got it,std::thread is in C, but std:: async is not ((
Just reading this book now )) Parallel C++ programming in action, by Anthony Williams.
If you're interested the book is in the attachment, async starts at chapter 4, pretty easy to read.
And Kurt Ganteroth, in his book Optimizing C++ Programs, states that it is 14 times more expensive to create threads than to use std::async.
That's why I originally wanted to use async, but I didn't know much about threads in C/C++ either,
so ifthreads are more expensive, they're not worth using anyway.
But it turns out that in C,std:: async does not exist ((
A thread isn't more expensive, it's just a lower-level tool you can make anything from. You can make your own simple thread pool on "expensive threads" - an hour of writing (or take a ready-made lib).
creating threads is 14 times more expensive than using std::async.
Maybe if there's a thread pool inside async, but that's not always the case https://stackoverflow.com/questions/15666443/which-stdasync-implementations-use-thread-pools.
As a result, async is such a black, uncontrollable box. I don't urge you to write your own pool, if you feel comfortable with async, fine.
ZS: there were rumours that async was going to be removed from c++17.Async can be executed synchronously, there is a flag for it. I think thread pooling on pluses is complicated and only makes sense to write it in case of extreme necessity. You'd better take a look at Sharp, at that thread pooling.
I would also recommend "Scott Meyers: Efficient and Modern C++". 2016, easy to read, like a blockbuster. I've attached the archive below. He has an interesting chapter on threads. And in general, Meyers should be read, because you have to )))
I think thread pooling on the pros is tricky and only makes sense if it's absolutely necessary.
Don't make it any harder than it needs to be. If you don't want to write it yourself, you can easily take a ready-made one, a quick search here https://github.com/vit-vit/ctpl. And it is something less predictable, unlike async (which is often criticized).
Don't make it any harder than it has to be. If you don't want to write it yourself, you can easily get a ready-made one, here is a quick search https://github.com/vit-vit/ctpl. And it is something less predictable, unlike async (which is often criticized).