« first day (252 days earlier)      last day (2592 days later) » 

1:56 AM
How to check my c++ program running on how many cores?
 
2:22 AM
@AlexCerry what os?
 
@jamesson Windows 10.
@jamesson see this website example 1.ashishgrover.com/boost-multi-threadingfor-c
@jamesson Its running on same time.
 
I think task manager>details, but I am not convinced yet
 
@jamesson task manager not tell you. Your program running on how many cores.
 
Under details tab, there is a column cpu
also try process explorer powertoy (free from ms)
 
void readerApi()
{
for (int i = 0; i < 10; i++) {
//usleep(400);
Sleep(1000);
std::cout << "Thread1:" << i << std::endl;
}
}
void writerApi()
{
for (int i = 0; i < 10; i++) {
Sleep(1000);
std::cout << "Thread2:" << i<< std::endl;
//usleep(400);
}
}
 
2:28 AM
Yea that code helps nobody with nothing
 
:36194196 No, the console output
 
@VermillionAzure console output. Thread1:0 Thread2:0 ...... Thread1:9 Thread2:9
 
@AlexCerry What's wrong with that?
 
I dont think he believes i
*it
 
@VermillionAzure Nothing wrong. Just want to now. Is it running on two cores?
 
2:30 AM
Which is fair enough, although perhaps misguided
 
@AlexCerry Ah I see.
@AlexCerry You won't be able to know. You shouldn't
@AlexCerry Threads are usually handled by the OS. Because hardware differs, and threads are meant to work on any number of cores or scheme that have virtual threads, usually you can't do that unless you interact with the OS or get into another lower-level API.
 
@VermillionAzure Output time is same. What does that mean?
one core not able to do that.
 
@AlexCerry It probably just means that they're waking up at nearly the same time.
@AlexCerry And, another idea is that your output is being buffered. Have you tried timing the actual time since the beginning of the program in microseconds or nanoseconds?
 
@VermillionAzure I will try tic tac.
@VermillionAzure Thank you very much for your help.
 
@AlexCerry What is "tic tac?" Just use std::chrono and its facilities with std::chrono::high_precision_timer
also use std::chrono::duration and std::chrono::duration_cast and the various built-in time types
 
2:34 AM
@VermillionAzure tic mean (clock start) and tac mean (clock stop).
 
@AlexCerry Never have heard that before.
 
@VermillionAzure no matter.
 
 
1 hour later…
4:04 AM
ok, sorry, but I must admit I am totally lost. I am trying to build simple C++ console executable in vs2015. First I tried adding it to an existing project. It built as an object file (after ctrl+f7). Then I tried opening it by itself. It did not build. How can I make it build as executable?
 
New Project -> Win32 Console Application
 
@Mikhail, so this is - literally - the only way to precomplie existing code? I was hoping to avoid 20+ solution files
 
just drag the stuff in
there are wacky things like makefile file projects
 
OK, drag it into where exactly? I tried dragging it before a couple times with a wiin 32 (not console) project, and it did not allow me to
And when I did succeed in dragging it in, all I got for output was object files
 
 
9 hours later…
nwp
1:18 PM
@jamesson In VS2015 it is. VS2017 invented an "open folder" feature which lets you avoid creating a project just to build the code and if the code is simple enough to build it might actually work.
 

« first day (252 days earlier)      last day (2592 days later) »