Multithreading In C++

Поділитися
Вставка
  • Опубліковано 20 сер 2024

КОМЕНТАРІ • 296

  • @cid007007
    @cid007007 4 роки тому +30

    I crosschecked many times and pasted your code also but same result... With thread.. it takes 13 secs but Without thread it takes 10 secs.. how ?????

    • @CppNuts
      @CppNuts  4 роки тому +2

      Did you took latest code i updated in video details.
      I have provided link.

    • @cid007007
      @cid007007 4 роки тому +1

      @@CppNuts Yes rupesh... latest one from link where you are passing reference of OddSum and EvenSum instead of making them global variable....

    • @CppNuts
      @CppNuts  4 роки тому +1

      Then no idea why is it like this.
      I have 3 system i check in every system but not getting this issue.

    • @likethat111
      @likethat111 4 роки тому +7

      The problem here simple addition is being used +. Load on the CPU is decided based on machine instructions finally. Replace + with say sin(i) function. Then we can say the advantage of thread parallelism over single. I tested and it is working. Also when trying with sin function, reduce last to 190000000(or have floats) otherwise it might take lot of time.

    • @sebasman1000
      @sebasman1000 4 роки тому +19

      creating a thread is quite an CPU intensive task. So for simple straight forward functions on an older CPU is not always faster when threaded

  • @CppNuts
    @CppNuts  5 років тому +15

    Hi guys,
    Hope you enjoyed the video, more advance video is coming in few days on thread topic.
    And please let me know if i can provide something else on this topic.
    Your support is appreciated.
    LIKE & SUBSCRIBE for more videos like this.

    • @WithHumble
      @WithHumble 5 років тому +1

      Your efforts are really appreciated and is helpful for many of us.

    • @CppNuts
      @CppNuts  5 років тому

      @@WithHumble Thanks man, it really motivates to create more videos.

    • @s-a-k-e1814
      @s-a-k-e1814 4 роки тому +1

      Hi, I have two questions... can I run the same function with different threads (at the same time obv)?
      And how should I manage the return of my function? ( something like this "result= thread t0(example,1); " ? )

    • @CppNuts
      @CppNuts  4 роки тому +2

      That comes with future and promise topics in cpp, i will start soon.

    • @s-a-k-e1814
      @s-a-k-e1814 4 роки тому

      @@CppNuts thanks, I need it so much... :) Anyway why didn't you used "using namespace std;" it is so useful...

  • @nitishjaiswal
    @nitishjaiswal 4 роки тому +12

    Explained in simple way. Way better than other multi-threading tutorials. Kudos to you guys.

    • @CppNuts
      @CppNuts  4 роки тому +2

      Thanks man!!

  • @edwin3928ohd
    @edwin3928ohd 4 роки тому +8

    Thank you for the step-by-step instructions. I did not understand other videos, but you kept it simple and now my program runs in 1:17 and not 5:40. (4 threads) Thank you!. Subbed

    • @CppNuts
      @CppNuts  4 роки тому +4

      Great.. Things like this encourages me like anything.. 😍🤓

  • @ShivaVRGames
    @ShivaVRGames 2 роки тому +5

    We can use "auto duration = duration_cast(stopTime - startTime); " to get the seconds directly instead of getting in micro sec and then dividing it to get in seconds.

  • @CppNuts
    @CppNuts  4 роки тому +1

    There are so many questions about the program not behaving correct on different systems, so i double checked everything and found that if we pass by std::ref which i did then it is some how behaving different in some system, so i have made some changes in program, now instead of std::ref i am sending the old school address and it is working fine.
    check it out: ideone.com/ypngpe
    let me know if link is not working i will create another one.

    • @mouryas5791
      @mouryas5791 4 роки тому

      Hi Rupesh, with threads and without threads the execution time is same no difference,

    • @CppNuts
      @CppNuts  4 роки тому

      What is the configuration of your computer?

    • @mouryas5791
      @mouryas5791 4 роки тому

      @@CppNuts i5 processor with 8Gb of ram

    • @CppNuts
      @CppNuts  4 роки тому

      We have to setup program one I have explained in video and one I have given in the link so, in both the cases is it same or it's different.

    • @sab229
      @sab229 4 роки тому +1

      I ran the program given in the above link in Cygwin and it ran in time twice of what it took to run without the threads. More specifically the time for code with threads took 17 seconds and without threads, it took 9 seconds. Is there an issue with running threads in Cygwin?

  • @NotJaazmine
    @NotJaazmine 10 місяців тому +1

    thank you! you’ve explained this so well. feeling more confident about threads already

  • @chavhanshrihari3461
    @chavhanshrihari3461 4 роки тому +2

    Amazing Rupesh... This i would call a social service....Keep it up... Clear cut explanation. God bless you...

  • @digikiwam
    @digikiwam 3 роки тому +7

    Bear in mind, threading doesn't always mean your execution time will be faster. There are a lot of factors that can make threading even slower than serial.

  • @user-ii2hp9tp1z
    @user-ii2hp9tp1z 2 роки тому +1

    I absolutely love how he drew his channel logo at the end, you're cool 😎❤️

  • @timmyxuereb3083
    @timmyxuereb3083 Рік тому

    when you were interrupted, it was a perfect example of threading

    • @CppNuts
      @CppNuts  Рік тому

      Yes that's correct !!

  • @Sandroidus
    @Sandroidus 3 роки тому +4

    1. All performance testing should be done in Release. It should be mentioned. (Otherwise 2-threaded version may take longer time to execute).
    2. What is the point of duration_cast and then dividing it by 1000000 ? Why not to duration_cast ?

    • @pavelkravchenko2810
      @pavelkravchenko2810 3 роки тому +1

      Pls explain about the testing in Release, cuz I have this result with 2 X time 🤷‍♀️

    • @cid007007
      @cid007007 3 роки тому

      @@pavelkravchenko2810 I have faced same issue.. it was taking almost 2x time with 2 threads. So these are steps that resolved my issue :
      Editor -- XCode
      1) Product -> Scheme -> Edit Scheme -> Change Build Configuration to "Release"
      2) Now clean Build -> Run app
      you will get desired result shown in video.. :)

  • @Byynx
    @Byynx 5 місяців тому

    I would never thought that i would discover that with a bitwise operators i could check if a number is odd or even. This makes me wonder the world of possibilities that bitwise operators can give.

  • @nusud
    @nusud 4 роки тому +2

    hello, i wanted to thank you for keeping it simple! the example is great, as well as the explanation! keep it up! cheers!

  • @scutursula7536
    @scutursula7536 5 років тому +3

    Very useful. This subject is very interesting, i hope you'll talk more about it in your next videos. Keep up with good work.

    • @CppNuts
      @CppNuts  5 років тому

      Sure man, and thanks for the comment.

  • @jayantjain2210
    @jayantjain2210 9 місяців тому +1

    How are you running thread in sublime text
    My sublime is giving me this error:
    In function 'int main()':
    error: 'thread' was not declared in this scope
    thread t1(temp);
    ^~~~~~
    error: expected ';' before 't2'
    thread t2(temp2);
    ^~
    error: 't1' was not declared in this scope
    t1.join();
    error: 't2' was not declared in this scope
    t2.join();
    ^~
    [Finished in 668ms]

  • @harounlouati6602
    @harounlouati6602 Рік тому

    I really like the way how you explain things. Thank you so much.

  • @user-xw6ns6ih5f
    @user-xw6ns6ih5f Місяць тому

    walking up by alexa is cool

  • @teetanrobotics5363
    @teetanrobotics5363 4 роки тому +1

    Please make tutorial on C++ boost library. There aren't many tutorials online and also your channel focuses on C++

  • @user-mu2qq3eb7t
    @user-mu2qq3eb7t 4 роки тому +3

    you said it, I love C++! And I love Hindi!

  • @ka-hp4qf
    @ka-hp4qf Рік тому

    Excellent vedio which can be easily understood

  • @akashtiwari78059
    @akashtiwari78059 7 місяців тому

    you explaination is unbaeatable

  • @amentothatt
    @amentothatt 3 роки тому +1

    Very eloquently explained, great Vid. Subbed!

    • @amentothatt
      @amentothatt 3 роки тому

      Salutes from a Chinese fellow engineer

    • @CppNuts
      @CppNuts  3 роки тому +1

      Thanks dude..

  • @andreiasimas2984
    @andreiasimas2984 Рік тому

    Hi, guys. In QtCreator it only works in release mode. If you put debug mode you will see a bigger time.

  • @abhishekkumar-os5ey
    @abhishekkumar-os5ey 2 роки тому

    I love c++ ♥️. Because,it power the world.

  • @experimentalhypothesis1137
    @experimentalhypothesis1137 5 років тому +1

    very good example, perfect explanation

    • @CppNuts
      @CppNuts  5 років тому

      Thanks for the comment man!

  • @rampandi9302
    @rampandi9302 5 років тому +1

    Superbb explanation sir. I will never miss yr videos 😍😍😍

    • @CppNuts
      @CppNuts  5 років тому +1

      Thanks for your support man!!

  • @alfoom6922
    @alfoom6922 2 роки тому

    Great video. Greetings from Spain

  • @Durgasivakumaran
    @Durgasivakumaran 3 роки тому

    I just love all your videos and teaching sir... Grt😍👍

    • @CppNuts
      @CppNuts  3 роки тому

      Glad to hear that

  • @shaikthouheed9158
    @shaikthouheed9158 2 роки тому

    With the below program the timing issue will be solved:
    The problem is passing reference in thread, If reference and pointers removed it will work.
    Below is the program
    #include
    #include
    #include
    #include
    using namespace std;
    using namespace std::chrono;
    typedef long long int ull;
    void findEven(ull start, ull end, ull EvenSum) {
    for (ull i = start; i

  • @sebasman1000
    @sebasman1000 4 роки тому

    hey man, absolutely love your explanations video's. But if I can give you 1 tip, make your intro sound a little less loud. You have a very calm soft voice, so during the video I turn my volume up but when another video starts playing from your playlists I almost go deaf from your intro sound. But keep up the good work, loads of love from a jr. developer in holland

    • @CppNuts
      @CppNuts  4 роки тому

      I was wonder if that is an issue. Thanks for the tip.

  • @toutsujet
    @toutsujet 5 років тому +1

    Very nice video, thancks, it helps beginner like me

    • @CppNuts
      @CppNuts  5 років тому

      Thanks for your comment man!!
      I love when someone write that my videos are helping.

  • @govindkothari7989
    @govindkothari7989 4 роки тому +1

    Well explained sir.
    Your work is appreciated

    • @CppNuts
      @CppNuts  4 роки тому +1

      Thanks man!!

  • @khurramsaqib5890
    @khurramsaqib5890 2 роки тому +1

    I am using VS Code with MinGw compiler and getting the error message "thread" was not declared. I ensured to copy the code correctly, but the program is not running, any suggestions?

  • @user-ky6vq6hj8y
    @user-ky6vq6hj8y 10 місяців тому

    loved it, best explanation done

  • @srinu571
    @srinu571 4 роки тому +2

    I am surprised by seeing the result in my VS2015, without threads it took 9secs and with two threads it took 20Secs for the same program.It's strange..

    • @CppNuts
      @CppNuts  4 роки тому

      Please check the code link in description field.

    • @srinu571
      @srinu571 4 роки тому +1

      @@CppNuts ​ Even with this new code (Passing evensum and odd sum address and taking as pointer in functions) taking more time 28 sec

    • @CppNuts
      @CppNuts  4 роки тому

      @@srinu571 No idea about visual studio, i have verified in Mac and Linux.
      May be some day i will run using visual studio and see if there is something i can do to overcome this.

    • @Sandroidus
      @Sandroidus 3 роки тому

      switch to release. never check performance in debug mode.

  • @bhagwatjadhav94
    @bhagwatjadhav94 5 років тому +1

    Hi just found your channel. thanks man lovin it.

    • @CppNuts
      @CppNuts  5 років тому +1

      Thanks man, i am out of station, next threading video will come around next week.

  • @adityasahu96
    @adityasahu96 3 роки тому

    getting error like this, using c++17
    error: 'thread' is not a member of 'std'

  • @shruthiv4566
    @shruthiv4566 4 роки тому

    Very nice series. Please continue to make some great content. Can you make a series on ipcs n socket programming

  • @himanshurajpal7842
    @himanshurajpal7842 3 роки тому

    What's your source of knowledge ? I mean what do you read , which book you follow ? Which resources you follow for learning C++

  • @karimmuhammad149
    @karimmuhammad149 3 місяці тому

    when i replaced my sync code to thread code, took more time XD lmao, why my luck like that in always

  • @abelashenafi6291
    @abelashenafi6291 Рік тому

    You're just awesome mate. Thanks a lot

  • @nageshtuppad6736
    @nageshtuppad6736 5 років тому +3

    I wrote exactly same code visual studio
    its taking 21 seconds without thread concept
    by using 2 separate threads as you did its taking double 40 seconds..
    its happening ulta...

  • @nickpratap9161
    @nickpratap9161 7 місяців тому

    Thanks

  • @AmitParopkari
    @AmitParopkari 3 роки тому

    wow, this is really nice demo & explanation, thanks

  • @raxit2684
    @raxit2684 3 роки тому

    Alexa learning to program herself!

  • @fenikatharotiya4333
    @fenikatharotiya4333 Рік тому

    very much nicely explained !!

  • @nitinverma1421
    @nitinverma1421 5 років тому

    Explanation was great that helps keep doing good work thanks

    • @CppNuts
      @CppNuts  4 роки тому

      Thanks for the encouragement dude!!

  • @amargandhi1137
    @amargandhi1137 4 роки тому +1

    Hi sir
    Can you please explain me if two threads are trying to access same code in singalton class in C++ please I humble request to you

  • @lucasrfma
    @lucasrfma 3 роки тому +1

    Hey guys, I was having the same problem I see many of you talk about here:
    Single thread 9seconds, 2 threads = 14seconds.
    Checking the comments I saw someone talk about debug and release modes and how to change that in the IDE he uses, so I searched about it on google:
    Try compiling using
    g++ -O3 filename
    or
    g++ -Ofast filename
    Using the -Ofast I got 2.3seconds single thread, 1.17 seconds 2-threads. Did NOT see that coming haha.
    There are some explanations about this stuff here:
    gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html

  • @bhargavkumar5412
    @bhargavkumar5412 4 роки тому +1

    Hey Rupesh, which CPP editor are you using?

  • @avadhpatel111
    @avadhpatel111 4 роки тому

    Beautifully explained!

    • @CppNuts
      @CppNuts  4 роки тому

      Glad you think so!

  • @thotabharadwaj307
    @thotabharadwaj307 6 місяців тому

    why is my system taking 15 seconds to execute with threads and 5 seconds without threads

  • @bestganesh
    @bestganesh 3 роки тому

    It worked for me in Visual Studio 2019. (Code from Link in description)
    But the time take is different at every run.
    (I am running in Debug x86 configuration)
    Its 10s, 26s, 30s...

  • @sebastienleroux3122
    @sebastienleroux3122 Рік тому

    Not working on raspberry pi 3 :( Error from g++ undefined reference to `pthread_create'

  • @qichengu9202
    @qichengu9202 11 місяців тому

    In visual studio 2022 debug mode, multithreading does not have any speed benefits for this piece of code. Are there any experts here?

  • @nikhilkontam9988
    @nikhilkontam9988 2 роки тому

    Can you please create interview question series on threading?

  • @mizel_1121
    @mizel_1121 3 роки тому

    i need implementation thread and fork can you help im looking someone implement i need understand how its work please help

  • @yukinohana9366
    @yukinohana9366 2 роки тому

    Nice explaination, thank you sir

  • @yogeshvishnole1264
    @yogeshvishnole1264 3 роки тому

    Super video sir very very thanks.

    • @CppNuts
      @CppNuts  3 роки тому

      Welcome dude..

  • @muhndkalil9234
    @muhndkalil9234 3 роки тому

    Thank you for this video

  • @animetunes8963
    @animetunes8963 5 місяців тому

    what specification were you using?

  • @ayushmaankaul6742
    @ayushmaankaul6742 3 роки тому +1

    My multithreaded program took more time than sequential one. Why would that be happening?

    • @CppNuts
      @CppNuts  3 роки тому +1

      This should happen only when you have single core CPU. otherwise i do get comments like yours but can't really think of reasons.
      I tried myself in 3 different systems and it was giving less time while threading, so no clue, i am sorry for not been able to answer to this question.

    • @fang8660
      @fang8660 3 роки тому

      Apparently it depends on the system - multithreading isn't always faster for everyone depending on what you're doing.
      stackoverflow.com/questions/46759930/multithreading-slower-than-single-threading

  • @sagardeka2158
    @sagardeka2158 4 роки тому

    sir I wrote the same code, I gave start=0, end=2000000000 (=2B)
    but in my case multithreaded code took 37 seconds wherease normal code took 28 second....why?

  • @nitigya
    @nitigya 2 роки тому

    Why there is need of creating 2 threads? We already have one thread main() which can do say findEven and we can create only one thread for findOdd

    • @Nohomosapien
      @Nohomosapien 2 роки тому

      This is a small program that just finds sum of even and odd nuns but when you are coding a large application that has billions of lines of code eg. Google(2 billion lines of code), your program should be as fast as possible and it should be able to do multiple tasks at same time.

  • @nishantdhingra5985
    @nishantdhingra5985 4 роки тому

    can you please tell me how to compile it? And what changes we need to make if we want to run it in .c format?

  • @editprousama
    @editprousama 5 років тому +2

    Can you make a video on gui in C++ ?
    really need it thanks

    • @CppNuts
      @CppNuts  5 років тому +2

      I never worked on GUI in c++, so it will be little hard for me.
      I have worked but with QT and that was very basic, won't help much here.

    • @toutsujet
      @toutsujet 5 років тому

      @@CppNuts make video of qthead

  • @nandhannandhan8155
    @nandhannandhan8155 4 роки тому +1

    Font not clear with black background.

    • @CppNuts
      @CppNuts  4 роки тому

      So sorry to hear that!!

  • @prajwaldeepkhokhar7416
    @prajwaldeepkhokhar7416 2 роки тому

    Sir i have a question, lets say we have 10 threads and we want them to be able to pick up a job dynamically, (assuming we have 15 callable functions), how can we dynamically pass the name of functions and parameters? Do threads accept function names stored in variables?

  • @AjayKumar-kg6vo
    @AjayKumar-kg6vo 2 роки тому

    why it is showing error like:- error: 'thread' is not a member of 'std' Can you please help on this. I am running my code on vs code and minGW compiler installed

  • @lujainbanbouk8493
    @lujainbanbouk8493 3 роки тому

    thank you!

    • @CppNuts
      @CppNuts  3 роки тому

      You're welcome!

  • @hiranyakeshara1146
    @hiranyakeshara1146 3 роки тому

    please add a video of image processing using posix threads

  • @kinkajou23
    @kinkajou23 4 роки тому

    thank you a lot, you're a life saver

    • @CppNuts
      @CppNuts  4 роки тому

      Glad it helped!

  • @il4w
    @il4w Рік тому

    can you explain what might be happening when I calculate the sums using the main thread print time(comes out to be 8 seconds), when I do it using the 2 threads in the same execution of the program without commenting out the main thread calculation without use of threading it takes me aroudn 11 to 15 seconds via multiple threads then weirdly .
    But if i comment out the calculation of main thread and then execute just the multiple thread calculation it does almost half the processing time for the calculation.
    So basically when I execute these two methods exclusively the multithreading results in efficiency else if I execute the 2 scenarios together in the same run the multithreading actually takes more time weirdly ??
    This was all when done with debug configuration was debug though
    when i change config to release I get almost half the execution time with multithreading based approach even when running in the same run

  • @roopasaini5679
    @roopasaini5679 3 роки тому

    Text is not visible properly.it is blur

  • @teetanrobotics5363
    @teetanrobotics5363 4 роки тому +1

    Bro please make more videos during this period ?

    • @CppNuts
      @CppNuts  4 роки тому

      I have to do work from home, and i get more tired. But today one video is coming. And you are right i should try more during this period.

  • @zilola86
    @zilola86 3 роки тому

    finally got it!! thank you :)

    • @CppNuts
      @CppNuts  3 роки тому

      You are most welcome..

  • @ChandraShekhar-by3cd
    @ChandraShekhar-by3cd 5 років тому +2

    Hello sir could u plss share some resources from where u get these things..that will be helpful

    • @CppNuts
      @CppNuts  5 років тому +2

      My knowledge is from stackoverlfow. i was involved in stackoverflow and used to give answers to people and see the answers for my doubts and there were so many discussion, i learned alot from there.

    • @ChandraShekhar-by3cd
      @ChandraShekhar-by3cd 5 років тому +1

      @@CppNuts Thanks for reply..but is there any specific book or sites u visited earlier in ur initial learnubg phase..if u could throw some light definetly it wud help beginners like me and all

    • @CppNuts
      @CppNuts  5 років тому +2

      Duede trust me there is nomagic stick, i can tell u one thing only which might be of help.
      Decide a topic what ever it is and then fuck the internet for hunting more and more about it, thats it you are now master at that topic. Thats All!!

    • @iamravishank
      @iamravishank 5 років тому +1

      There is only one website.
      Google.com
      😊😊

    • @CppNuts
      @CppNuts  5 років тому

      Ravi Correct!!

  • @ashishkushwaha3812
    @ashishkushwaha3812 3 роки тому

    video starts at 8:30

    • @CppNuts
      @CppNuts  3 роки тому

      Really.. 😂
      I had to check and found that i was giving insight before.

  • @ghostknight3175
    @ghostknight3175 3 роки тому

    my M1 Mac is taking 8 see without thread and 2 sec with thread why?

    • @CppNuts
      @CppNuts  3 роки тому

      It is good right?

  • @devprakash5320
    @devprakash5320 3 роки тому

    this video was helpful

  • @user-lw6jt1nt4k
    @user-lw6jt1nt4k 3 роки тому

    thanks, very clear !

    • @CppNuts
      @CppNuts  3 роки тому

      Glad it helped!

  • @vvpChannel3112
    @vvpChannel3112 3 роки тому

    Sir What happens if a Thread finishes before OS calls Join( ). Does Thread joins the main program even in that situation ?

  • @codevoitrachhaha1928
    @codevoitrachhaha1928 3 роки тому

    I'm vietnammess, I not good english. But your vidio is very nice.

  • @sony1979iq
    @sony1979iq 3 роки тому

    ok.. but after we make threading, how many thread did the program made? is it parent thread main() and 2 child threads?

  • @amitrandive1509
    @amitrandive1509 4 роки тому

    Your content is good but the ads in between breaks concentration and it becomes irritating. I am posting this comment after watching 2 ads in just first 5 mins. That is ridiculous.

  • @milan_shah
    @milan_shah 4 роки тому +3

    Thanks for making this video. It was very helpful.
    However, when I ran the code, shown in the video as well as mentioned in the above link, it takes more time when use thread compared to when I don't. For example, for the code mentioned at the above link, it takes 7 seconds to execute the code with threading; while it takes 6 seconds when I'm not using threading!! (I'm running the code using VSCode in Ubuntu 16.04)
    Do you have any idea? Why it's happening?
    Thanks again :)

    • @lucidlynxxx
      @lucidlynxxx 2 роки тому +1

      same prob with me...

    • @lucidlynxxx
      @lucidlynxxx 2 роки тому +1

      and its also giving this output OddSum 950000000
      EvenSum 950000001

  • @rajeevdas8213
    @rajeevdas8213 4 роки тому +1

    Do you have any video on thread that explains thread scheduling techniques

    • @CppNuts
      @CppNuts  4 роки тому

      No, i may have in future, thanks for the topic.

  • @kingage4138
    @kingage4138 11 місяців тому +1

    Alexa wake up 😂

    • @CppNuts
      @CppNuts  11 місяців тому

      Haaeee this is Alexa.. what do you want...

  • @user-kn1gt7uv3v
    @user-kn1gt7uv3v Рік тому

    can anyone help to debug this below error
    error: 'thread' is not a member of 'std'

    • @CppNuts
      @CppNuts  Рік тому

      How r you compiling?
      Command ?

  • @chandravirsingh1184
    @chandravirsingh1184 5 років тому +2

    Hi Sir, which IDE you used in video's? I am looking the same IDE ? is it available for Windows or Mac?

    • @CppNuts
      @CppNuts  5 років тому +1

      I have used Sublime text editor 3.
      But this is editor you will have to link compiler with it.
      And it available in mac n windows both.

  • @thegoddessgeek1190
    @thegoddessgeek1190 2 роки тому

    question, what happens when the second thread finishes first before the first thread? will the t1.join() wait for the t1 to finsh before it can t2.join() wait for the t2? or.... both of this join() will run parallel too?

    • @CppNuts
      @CppNuts  2 роки тому

      Yes it will wait.

  • @awaisnawaz2791
    @awaisnawaz2791 3 роки тому

    Can you please tell me which IDE this is?

  • @bhargavpatel4781
    @bhargavpatel4781 3 роки тому

    Sir what is idle trigger

  • @antonfernando8409
    @antonfernando8409 2 роки тому

    C++ threading class may be cool, but nothing like using the native Linux pthread_create() like POSIX APIs to manage your threads, also note that not all thread related services are in the c++ class, for example, pthread_cond_wait(), signal and broadcast APIs which helps a producer thread to wake up waiting consumer threads. Perhaps in the case of writing highly portable c++ code, might be useful to use the thread class. any thoughts?

    • @CppNuts
      @CppNuts  2 роки тому

      If portability is what you need the most then you can go with C++ otherwise POSIX is great choice.

  • @mokera3801
    @mokera3801 4 роки тому +1

    which compiler are you using?
    I am using MinGW and it's showing an error :(

  • @pk471
    @pk471 3 роки тому

    sir how to get these code?

  • @bhaskarchary6683
    @bhaskarchary6683 3 роки тому

    Where can I get all these sample?

  • @himalayasinghsheoran1255
    @himalayasinghsheoran1255 4 роки тому

    Hi, I have an issue program without use of thread takes 8sec and the one with thread takes 13-17 sec. My laptop have an i5-9300H processor.

    • @CppNuts
      @CppNuts  4 роки тому

      There are so many questions about the program not behaving correct on different systems, so i double checked everything and found that if we pass by std::ref which i did then it is some how behaving different in some system, so i have made some changes in program, now instead of std::ref i am sending the old school address and it is working fine.
      check it out: ideone.com/ypngpe
      let me know if link is not working i will create another one.

    • @srinu571
      @srinu571 4 роки тому

      @@CppNuts This link is not working

    • @Sandroidus
      @Sandroidus 3 роки тому

      You're running in debug mode. Switch to release

  • @vijayasajwan2830
    @vijayasajwan2830 5 років тому +1

    Can you Share the link (GitHub/any other URL) for the code used in the vedio. Is there any vedio for C++20?

    • @CppNuts
      @CppNuts  5 років тому

      I have started writing, will post ASAP it is done.
      No i don't have c++20 video for now but will cover it in near future.