Home > Software engineering >  Thread can't perform, is XP, 08 r2 problem or MSVC BUG?
Thread can't perform, is XP, 08 r2 problem or MSVC BUG?

Time:09-22

A few days ago in the business of code using c + + 11 in the future, in the Windows of 10 a few test machine completely normal, no problem,
The results on the client machine, found that it just won't work, the code is as follows:
The class SysMisc
{
The static BOOL GetScreenShotLQ ()
{
Auto InitFx=[& amp;] () - & gt; ULONG {/*... */};
Auto fInit=async (InitFx);
FInit. The get ();//because the thread doesn't perform, jams,
}
};
The function called about this
The class streamControl {
The static BOOL ProcessFunction ()
{
Auto fSc=async (& amp; SysMisc: : GetScreenShotLQ);//do not perform, will only assign future The memory of
//...
FSc. The get ();//jam
}
};
All above async do not perform in Windows Server 2016 and 10 normal completely, but in the use of XP, 08 r2 virtual machine or physical problem has appeared in a physical machine,
Replace the SDK cannot be solved, either 64 or 32 bit compilation, has problems in 08 r2, XP is SDK7.1 A, 32-bit compiler,
Wonder whether where there is a problem, is the BUG or XP MSVC, Server08R2 problem?
Novice small white, also met the socket under XP will always return 1, judging by removing solve temporarily,
Images:

Above the red line for Windows 10 under all normal (tablet computers, laptops, all-in-one PC, desktop several devices), and so on, but the virtual machine or physical machine XP, 08 problems under the r2,

The above problem is the same/
And is clearly a list of erase operations, it is impossible to appear problem, but it happened that imploded under XP and r2, this is the runtime, kernel problems or compiler generates code for the optimized Win10 do? Under 10 will not collapse, no matter how to erase all no problem (iterator erase every time point after the begin of the list), and do a red-black tree, erase operation in Win10 no problem,
All the above problems are using VS2017 (the latest version 15.8), MSVC14.1, this is a compiler BUG or system problem?

CodePudding user response:

Try the assembly level debugging

CodePudding user response:

The compiler should have to choose the with XP on the right

CodePudding user response:


Vs a list of the weird, version different erase, two vs validated,

About the thread, the old machine running failure, need to debug, run the process first hit the log, key parameters also log, to see where there is a problem,

CodePudding user response:

There is a problem what is mean? Don't run? Collapse or something? The lack of related library,

CodePudding user response:

reference 1st floor schlafenhamster response:
try assembly level debugging

C + + debug want to die, async is accounted for memory, but function didn't perform,,, then get blocked

CodePudding user response:

reference smwhotjay reply: 3/f

Vs a list of the weird, version different erase, two vs validated,

About the thread, the old machine running failure, need to debug, run the process first hit the log, key parameters also log, to see where there is a problem,

Is to find the function debugging, inside something didn't perform, Win10 everything is normal, very experienced,
Now temporarily implements list and red and black bintree, doubt is a problem with the standard library

CodePudding user response:

reference 4 floor VisualEleven response:
problems is what mean? Don't run? Collapse or something? The lack of related library,

Async cannot execute the function body, did not create a thread, the list action collapse, all normal Win10, feeling is the paranormal

CodePudding user response:


To compile vc xp environment, according to my personal experience, this is the last one can perfect support of vc version
And although vs2017 tag has to support the xp environment of choice, but actually I haven't worked a
Estimate your problem also there
If you are using c + + 11 features, but it doesn't make much difference whether
Because when compiling c + + 11 connection will be automatically mapped to native code
So the problem or the SDK version you choose is too high, can't support the xp

But, in truth, so many years has been using c + + 99, this code Windows Linux, Unix was not afraid of vs version change, there is no need to use c + + 11

CodePudding user response:

A platform options, under the project properties to choose with XP to run,
  • Related