Hello everyone ! I have a problem and hopefully some of you know how to solve it. I have a bunch of independent task some are large, some are small can't know before doing them and I have a thread pool. I wanted to know if it is possible to keep the threads busy (I am quite new to threads).
I thought about launching all the thread and joining them afterwards but then the slowest thread would give the pace. I am sure this is a classic problem but google didnt help in my case. Thanks for your help !
@Cinch Not necessarily. Hitler tried to remove them from the gene pool by killing them, and he also judged "idiot" purely based on what hair colour they had. If you, say, genetically engineered their children to have scientifically proven higher intelligence, that could work, if you had sufficiently advanced genetics technology anyway.
@BartekBanachewicz what do you mean by that? afaik its not supported on android or ios... you'd have to create the platform specific hooks for catching events and all
it's because we educate our children in a tremendously ineffective fashion, and also because somehow we seem to smack all women into thinking they cannot program.
@BartekBanachewicz the whole point of glfw is to abstract that away. given that glfw has support for ES, it probably works on embedded linux or whatever with X events too. Capturing input events from mobile OSs like android and ios isn't that different... certainly not as convenient as with the desktop, but not an impossibility. In fact id be surprised if glfw doesn't have support for more mobile os's in the future
@BartekBanachewicz 'totally different way'... please elaborate. They seem pretty similar to me. SDL supports mobile OS's for example, and what it does is extremely similar to glfw for opengl support and input handling
@BartekBanachewicz touch input is just an event, app sleeping is just another event, you don't need to worry about notifications since thats not glfw's responsibility
@Puppy I totally agree, but how many people can successfully create an educational system that can do that? That's like the pinnacle of education--the younger they get, the harder it can (or maybe not) be
they're all about how to model what you want and whether or not what you want is even possible and did that dude expose that API and how am I going to make this change in a compatible, easily-maintainable way.
But then you have people asking questions like, "Why doesn't C++ support this function from Python?" when the answer is because C++ doesn't have that abstraction and is giving you a closer abstraction at reality
C++ typically doesn't support a Python function just because it's a library problem and has absolutely nothing to do with the languge.
like for example filesystem operations are not in C++ but you can just download Boost.Filesystem if you need them, because filesystem ops are just a library you ca write on top of any operating system.
Just learn as many languages as possible, grow your own ideas, check them with others' and (as a result) possibly change your mind, ask when you're stuck, repeat. There's no such a thing as "here's all the stuff you have to read or languages you have to learn, go through it and come back as an expert"
If you wanna give others directions, and expect them to follow those directions, then (assuming those people are not dumb) you'd better be ready to provide solid evidence that those directions make sense, and meaningfully answer questions and objections. And if you haven't spent your own time trying to follow those directions, and sweat to overcome the obstacles, it's very unlikely that you will be able to convince anyone. If you want to become an educator, first be a student.
@BartekBanachewicz Would you say I have learned C++? (Let's limit this to C++03, to get the obvious obstacles out of the way.) I ask because I consider the thing inaccessible for me. Yeah, in a way I understand what's in there. But certainly not through reading it myself.
@Pris Was that a Freudian slip or an intentional one? :)
@BartekBanachewicz In the same way that zero is "rather small"?
@BartekBanachewicz The languages I consider widely used are Java, C#, C, C++. Ruby, Python, Perl... When it comes to usage, is Haskel even in the league below them?
@chmod711telkitty I said "nap", and that I had. It seems the temperature has dropped a bit again. At least I feel like I am making more sense again. ICBWT.
@matovitch What do you mean when you say "small" and "large"? The time they run? In fact, there was a talk of Hartmut Kaiser at Meeting C++ in December where he addresses this very issue in a really good keynote. You can find this online. His thesis: You will always waste CPU time by joining tasks, continuations is what you're after.
But you don't even need to go that far. Create a queue of tasks to be done, and let all the threadpool threads simply fetch the next one from this. Voilá.