Комментарии:
with adding a token isn't not equal to sequential processing because at a time one one operation can happen ( i don't see the usefulness of multithreading here)?
ОтветитьThis is really helpful thank you Hussein.
Fan from egypt😊
is there a way to see threads stored in the code section of physical memory?
ОтветитьThe thing with the 2nd Steve is so funny😁
Ответитьcan some share that code bit
Ответитьreally awesome explanation !!
Ответитьvery helpful explanation for why mutex is necessary, I better understand now
ОтветитьI am allergic to that marker sound.
ОтветитьSuperbs explanation. Well done! Great editing too!
ОтветитьThis is coolest explanation..
ОтветитьMy solution instead of the token would've been to have a different variable for each thread, then adding them up at the end. Can't overwrite each other if they're not writing the same variable!
ОтветитьCould it be that C++ compiler or processor is smart enough to move synchronization out of the loop? Guess we need to check assembly, otherwise we will never know if the computer is FAST or SMART =))
ОтветитьLove the explanation, thanks other Steve!
ОтветитьWrite-after-write hazard. Perhaps a faster, more scalable (and more complex) solution is to Map-Reduce. C compiler directives can help
ОтветитьMy husband works from home. He is a very intelligent programmer, he talks to me everyday. This stuff is one of them. I am just drinking coffee while listening to him. I had no idea what he is talking about every single day. Thanks for helpful video. I will watch this everyday.
ОтветитьYou have 2 Apples in front of you, and you choose to use a Microsoft???
ОтветитьThe best explanation of threads that I've even seen -- great job! Oh, and of course brilliant video production.
Ответить"This is getting out of hand, now there are two of them..."
ОтветитьWould you calculate how much electricity consumed in different experiments?
ОтветитьLearned a lot for this! Thanks!
ОтветитьI'd love you to learn RISC V assembly
ОтветитьCan you just explain what happens to a service when multiple say 1000 requests are sent at the same time. how multithreading can be related here ? thanks
ОтветитьWell I managed to find a way to do manual thread safety, here's a snippet from what I'm currently putting together, no mutexes or semaphores involved:
```
dint Send_AndWaitAll( THREAD *thread, OBJECT *object )
{
BRANCH *branch = GrabThreadBranch( thread );
if ( !thread )
return 0;
if ( thread != &main_thread )
{
SIGNAL *signal = GrabThreadSignal(thread);
OBJECT tmp = {0};
bool redo = false;
object->que = time(NULL);
signal->i = *object;
while ( 1 )
{
YieldOther();
/* Check if the thread sent us a signal */
if ( signal->o.que < object->que )
continue;
/* Check if the signal was the one we were expecting */
if ( signal.o.sig != SIGNAL_CONT )
{
tmp = signal->o;
redo = true;
continue;
}
break;
}
if ( redo )
{
tmp.que = object->que;
tmp.sig = SIGNAL_REDO;
signal->i = tmp;
}
}
Send_AndWaitAll( branch->Init, sig, object );
return Send_AndWaitAll( branch->Next, sig, object );
}
```
Nice this was very helpful
ОтветитьAwesome video
ОтветитьAnd at this moment I've found out that mutex stands for mutual exclusion
Ответитьwowww the editing was superb! nice job computerphile nice job
ОтветитьWhy is this a race condition and not a data race?
Ответитьyou dont need to have an os to do it, just have the first (boot) core to write to the program buffer of the other processors/core, assume bare metal multi core program
ОтветитьOne of my favorite vids by yall guys. Thank you !
Ответить👏👏👏👏👏👏👏👏👏👏
ОтветитьAmazingly explained !
ОтветитьJust blew my mind
Ответитьrace conditions
ОтветитьDoesn't that just end up making both threads run as fast as a single thread?
ОтветитьGreat video!
ОтветитьLoved the video! Absolutely great!
ОтветитьTHis can be used to generate random numbers.
ОтветитьSteve literally divided himself like a cell just for this example
thats some true dedication
Can you explain what would be the difference to using different variables a1, a2 for the parts of the program and run on 2 different threads? As I understand there wouldn't be a need to lock, but what are the downsides? :)
ОтветитьThe first time I felt smart watching a Computerphile video. I saw the code and the fact that both threads use the same variable and thought "That's not gonna work as intended.".
ОтветитьI understand so much now 😌 Those visual effects helped a lot 🙌🏾
ОтветитьVery helpful. I'm proficient in shell scripting and powershell overall for my work life, and recently started learning C. This helped me sort out a problem with one of my projects, so thank you for that. =)
ОтветитьDang, did he get that paper of ebay? ha.
Ответить