Юрій
no instance of constructor "std::thread::thread" matches the argument list c++
Anonymous
eg gist.github.com
Anonymous
#include <thread> std::thread th1(LorisThread, s, socket_address);
Юрій
https://gist.github.com/Nelkmen/9499deb5e24afd135a775d04958affa6
Anonymous
welp i found i hang that should not happen [ RUN ] ExecutionManager_Core.init_2 STOP THREAD AND WAIT FOR CONTINUE: -1 thread with pid: 388322 created thread with pid: 388325
Anonymous
try int instead of void?
Anonymous
/get howtoprogram
Anonymous
/get best-book
Anonymous
welp, i guess i race can happen even between int pid = ::clone(cloneArgs.fn, cloneArgs.child_stack, cloneArgs.flags, cloneArgs.arg); int saved_errno = errno; thread.pid = pid;
Anonymous
that is exactly how i learned :) loads faster than reading a big book and forgetting half of what you read :)
Anonymous
/get best-book
try these :) https://github.com/mgood7123/PDF/tree/master/C%2B%2B
Anonymous
oof [ RUN ] ExecutionManager_Core.create_wait_for_exit thread with pid: 486369 created thread with pid: 486370 CLONED STOP THREAD AND WAIT FOR CONTINUE: 486370 CONTINUE THREAD: 486370 boo! STOP THREAD AND WAIT FOR CONTINUE: 486370 CONTINUE THREAD: 486370 wait_for_state (pid 486369): unknown wait while waiting for state: STOPPED THREAD INFO: ... found in 13719 tries
Anonymous
glad i did not have to manually press up enter 13,719 times 😂😂😂
Anonymous
https://gist.github.com/5de091d0497b3f2912365d90da679173 is this too slow to be useful in debugging data races that can occur in extremely short periods of time (eg ~100ms) ?
Anonymous
https://gist.github.com/caed1168ee8ef5b609efb9c0a69ea92b *
Anonymous
how tf can this have failed? kill(pid, SIGCONT); waitpid(pid, &status, WCONTINUED|WSTOPPED) // hanged
Devjit
/rules
Anonymous
Hi everyone
Anonymous
Im beginner in programming Just learn a bit C++
Heisenberg
Ammar
how tf can this have failed? kill(pid, SIGCONT); waitpid(pid, &status, WCONTINUED|WSTOPPED) // hanged
When you send SIGCONT, the process is resumed. After it gets resumed, you call waitpid, the waitpid will hang until the process state change. In your case, waitpid does not catch the resume state because the process has already been resumed before you call waitpid. It won't hang if you specify WNOHANG.
Anonymous
I learn from youtube to use codeblocks
Anonymous
And have no idea in using visual studio.. Any advice for me to set up for C++?
Anonymous
Everytime i try to run there is always problem msg saying g++
Anonymous
/notes cpp-vscode
Thanks but i really have no idea what you mean
Anonymous
Can you please explain?
Suka
Can you please explain?
sorry my mistake. this group have note on setup cpp for vscode. #vscodesetup101 but as you can see i am having trouble fech the note hehehe
Anonymous
Can you please explain?
I think he tried to get the note
Anonymous
/get cpp-vscode
Anonymous
/get cpp-vscode
Okay will try
Anonymous
Okay will try
don't do it again just read it, this is the note
Anonymous
Thanks
Anonymous
Hi its opening launch.json
Anonymous
Anyway, i think its gonna be wasting time for all of you, maybe is there any youtube tutorial that can be trusted?
Anonymous
And don't use YouTube to learn C++
Anonymous
Sorry mate but thats all i got, cause im trying to get back on my foot right now
Yusuf
/get imhacker
Anonymous
fk it didnt work
Yusuf
/get cbook
OnePunchMan
/get
Anonymous
Why?
Because there is no good "tutorials"
Anonymous
Anonymous
#cppbookguide
Any video tutorial?
Anonymous
NO
😢
Anonymous
Ow guys i need minGW
Anonymous
Anonymous
Then please do tell, im a beginner and this is my first time using C++
Anonymous
When you send SIGCONT, the process is resumed. After it gets resumed, you call waitpid, the waitpid will hang until the process state change. In your case, waitpid does not catch the resume state because the process has already been resumed before you call waitpid. It won't hang if you specify WNOHANG.
how do i catch it? this is my code https://gist.github.com/Total-Control-9985/fff98dfab4efc84d071458d07dbdbd48 and this is my current output https://gist.github.com/Total-Control-9985/c9e09b8bafbe8220ccb295fcd546262d
Ammar
how do i catch it? this is my code https://gist.github.com/Total-Control-9985/fff98dfab4efc84d071458d07dbdbd48 and this is my current output https://gist.github.com/Total-Control-9985/c9e09b8bafbe8220ccb295fcd546262d
I don't really know what are you going to do. But at a glance I notice you did something wrong here. int status = wait(pid); The first argument of wait is not PID. It is a pointer to integer which will be the status.
Ammar
wait is my function
Oh, I thought it is from man 2 wait
Ammar
I didn't examine your code carefully.
Anonymous
int wait(pid_t pid)
Ammar
int wait(pid_t pid)
So, which function waits which function in this case?
Anonymous
wait is a wrapper around waitpid
Ammar
int wait(pid_t pid)
I am unsure how can it compile, as I think it will conflict with wait from <sys/wait.h>.
Anonymous
i think it compiles via function overload
Ammar
i think it compiles via function overload
Oh right, it's C++, I didn't realize it.
Anonymous
eg pid_t wait(int *wstatus); int wait(pid_t pid);
Ammar
how tf can this have failed? kill(pid, SIGCONT); waitpid(pid, &status, WCONTINUED|WSTOPPED) // hanged
So, in the code you sent, where do you do this? And why do you need to do?
Anonymous
im gonna upgrade it to std::optional<int> instead so i can distinguish between errors
Ammar
I don't really know which code is being waited. And how resources are managed. You need to explain more, so other can think of a solution.
Anonymous
im trying to recode wait
Pankaj
/get
Pankaj
/get
Anonymous
Because there is no good "tutorials"
How about c++ series from "the cherno" YT channel, I planned to follow this tutorial, what your opinion about this ? 😖😖😖
Ammar
updated the gist
I saw the update, but what is exactly your problem?