Hi, I'm learning to use the Parallel Patterns Library. How do I get how many threads have been created by PPL at any given moment?
Type: Posts; User: DrSnuggles
Hi, I'm learning to use the Parallel Patterns Library. How do I get how many threads have been created by PPL at any given moment?
I found an answer here, pointer functionality is indeed included in unordered_set:
And in a thread about unordered_set here:
Ok in any case, all the pointers will point to objects in the same array so that should not be an issue, right? Back to the initial question... will unordered_set handle the pointer...
Yes... Since two calls two new can never return the same memory adress you could of course never compare them and return true. But I don't get how that is relevant. A comparison would still return...
The pointers will all point to the same class type. Since pointer comparison just compares adresses, which boils down to something like an integer comparison, I'm guessing that such comparisons are...
Hi, I'm figuring out how to work with std::unordered_set.
Some sites indicate that you need to create custom hashing and comparison functions when using unordered_set with custom classes but is...
Got the same behavior as you.
SendInput solved the issue so I think I'll go with that. Thanks a lot!
For reference, I now do this at startup after window creation:
INPUT input={0};...
Hi, I'm using this code to determine if the left mouse button is currently pressed:
bool leftMouseDown = GetAsyncKeyState(VK_LBUTTON) & 0x8000 ? true : false;
..but it returns true until the...
That could very well be the case. Not sure about what memory bandwidth I have. It would be interesting to try asm though but perhaps it is not trivial. Perhaps I can go bug some people in an assembly...
Yes in my example I'm only doing one thing, assigning memory. Obviously the loop cases where I'm blending colors will take longer than just assigning the colors but that is a separate issue. In this...
It is sufficient. If the whole loop takes as an example 16 milliseconds and when I run only the assigning memory part it takes 15 milliseconds then I'm smart enough to figure out what is taking the...
You are asking me to profile my whole program? That is not what I'm asking for. How is timing how long something takes not profiling? I have profiled and come to the conclusion that it is the part in...
Well if I'm only doing one thing in the loop that that is what is slow. Like I said I have run the basic loop separately and found it takes too much time.
I have said I have timed different versions of the code, you are just going to have to take my word for it. Go with the example in the initial post if you find the if statements in the other example...
I have already tested and timed pretty much all different scenarios and not found significant improvements. Like I said I have tested to run the code with just plain loops so the if statements are...
When I tested I put the if statement outside the loops and did the background layer seperately. The timing was pretty much the same. One if statement did not change much. I'm not asking you to...
grumpy, I have tested to remove all the conditional statements (only one for the background layer) and the time is pretty much the same so it is obvious that it is the accessing and assigning of...
Thanks for the replies. Yes I should have included what the COLOR class is, it is a very basic 4 byte structure and looks like this:
class COLOR
{
public:
BYTE b;
BYTE g;
BYTE r;
BYTE a;...
Hi, I'm trying to get updating the pixels of an image as fast as possible. I'm wondering if there is some C++ magic I can apply to make it faster. Or some other kind of magic...
Right now I'm...
Hi, I have this function for taking a screenshot and extracting the pixels, it is working but I have a feeling it could be optimized and I don't really know what all the commands do. Can you spot any...
cyberfish, the m_fd pointer was indeed NULL. Should have checked that...
Anyway, the file creation itself is failing when using japanese characters when I have the system set to use japanese...
It seem that the problem could be occuring earlier in the code when the file is created, related to the file name in japanese. I'll be back after some checking.:)
Hi I'm trying to write a binary file (PSD) and have japanese language turned on on my computer right now. The program crashes when using fwrite, I think it has to do with that the system is using...
Thanks a lot, those works to get the size when the DPI has changed. There is another, perhaps more common way, to change the character size in the display properties though and that does not get...
Thanks, it seems that what you get from GetTextExtentPoint32 is not affected by changing the size of the text that is used in window captions and menus though so it is not what I'm looking for....