Java Multithreading Interview Questions

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

КОМЕНТАРІ • 54

  • @pankajdubey1310
    @pankajdubey1310 6 років тому +6

    The thread stack also contains all local variables for each method being executed (all methods on the call stack). A thread can only access it's own thread stack. Local variables created by a thread are invisible to all other threads than the thread who created it. Even if two threads are executing the exact same code, the two threads will still create the local variables of that code in each their own thread stack. Thus, each thread has its own version of each local variable.
    All local variables of primitive types (boolean, byte, short, char, int, long,float, double) are fully stored on the thread stack and are thus not visible to other threads. One thread may pass a copy of a pritimive variable to another thread, but it cannot share the primitive local variable itself.

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

      Because objects are reference pointers to memory structures, potentially shared, while primitives are "values"

  • @rkgoli
    @rkgoli 7 років тому +5

    good job man. nice brief summarisation and good articulation than lot of other multithreading videos, which are either too verbose, or too slow, or too digressing with not-that-straight examples, or not articulated well enough. Thanks a lot!! for the free service.

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

    Wow..Amazing Tutorial..Clear, covers a lot yet concise enough!

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

    I am 100% impressed

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

    Great Content, Can say that this video cleared my all doubts and all topics are clear now.

  • @shantipriya3088
    @shantipriya3088 2 роки тому +2

    The canteen has two windows for rice. (window 1 and window 2), each window has a master to provide meal service, and the window service time is as follows. Master a of window 1 is preferred to start the service. After cooking for three students, open window 2 and master B of window 2 starts the service. The total number of students is 30. Please describe the code implementation with multithreading mechanism.
    who can solve it?

  • @annukumari-vs7se
    @annukumari-vs7se 4 роки тому +1

    Asynchronous execution mechanism is defined wrong in the yellow highlighted box as it’s not capable of running in background but asynchronous means not waiting for the other thread to complete and execute simultaneously.

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

    great video

  • @prasadrayudu2001
    @prasadrayudu2001 6 років тому +3

    Really Helpful video Sir,Thank You :)

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

    great video. if i'm not mistaken, Future object would be derived from callable instead of runnable

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

    Excellent

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

    Well done!

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

    Amazing example

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

    Thanks sir!!!!!!!!!!!!!!!!

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

    I think your last example explanation is not correct. Thread.wait() is not used when you want to wait the completion of that thread but you use it on any object (not only thread) whose lock thread needs to give up so that other thread can lock it and then again acquire it back to complete the rest of the part.
    If you want to continue execution of thread after completion of other thread, then you need to use join() on that thread

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

    Where we can find your generics exercises code which you mentioned in Video? on GIT HUB?

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

    This is gold!!!

  • @phoenix3525
    @phoenix3525 6 років тому

    Well done.

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

    "Threads allow java code to run in parallel". That is not true. Parallelism is not guaranteed in java multithreading. Only concurrency.

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

    Thanks a lot!

  • @SS-or2om
    @SS-or2om 3 роки тому +1

    Where we can find these documents? Please share the link.

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

    🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥

  • @dhrub6
    @dhrub6 8 років тому +1

    Very well explained in detail. Where can I get the source code?

    • @johncanessa2250
      @johncanessa2250 7 років тому +1

      I found it at: github.com/in28minutes/JavaInterviewQuestionsAndAnswers

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

      @@johncanessa2250 this link dosent work for me 😔

  • @anirbanroy1524
    @anirbanroy1524 6 років тому

    Excellent video

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

    What if we will commented out the notify() from the Calculator class ?

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

      then main method continues to wait infinitly eventhough another thread is completed and thread.sum will never be executed

  • @moksudahmed3040
    @moksudahmed3040 8 років тому +2

    Why the Thread that will provide us the bowling statistics is called "battingThread2" ? Shouldn't we call it "bowlingThread"?

    • @PramendraRaghuwanshi
      @PramendraRaghuwanshi 7 років тому

      It's just naming convention, you can give whatever you want. BTW best practice we should have "bowlingThread" as you suggested.

  • @vikrantdheer8817
    @vikrantdheer8817 6 років тому +3

    Where we can find your multithreading & generics exercises code ?

  • @pankajdubey1310
    @pankajdubey1310 6 років тому

    how two thread can override the method argument value,every thread have own stack and method argument and local variable is maintained in the stack, can you please provide example and demonstrate, two thread can overide the local variable and share in between

  • @neerajarora100
    @neerajarora100 6 років тому +2

    The last example the wait and notify are called by locking on different object.. not a good practice as you may miss a signal !!
    Also in the last example you could have simply used join. Not an amazing example to show wait and notify ...

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

    Very short explanations with no significant terminologies used. Its okay to keep it brief but should highlight important aspects else it not much of a use. Felt same with Design Pattern videos.

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

      People starting complaining about video..... they don't know that Video title is Interview questions and ans.

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

    wow

  • @PraveenKumar-ew2xo
    @PraveenKumar-ew2xo 7 років тому +1

    Can u provide this PDF link ?

  • @pulpopulpo5383
    @pulpopulpo5383 6 років тому

    Where can we donwload a complete pdf or ppt file with all the explanations of each question?

  • @alokyadav9684
    @alokyadav9684 6 років тому

    Tysm

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

    Voice not good sir.use indian English and in udemy plese provide along with your bord explanation video.not always eclipse focus on camera not good.and plese tell clarify sir.clarfication not reached

  • @soumyababu7692
    @soumyababu7692 6 років тому +1

    source code of the eg?

  • @umeshnaik844
    @umeshnaik844 7 років тому

    One big question why wait and notify methods in object class not in thread class?

    • @LovyGupta007
      @LovyGupta007 6 років тому +1

      communication will be a big problem in that case. For ex while notifying you need to know all the threads who are waiting and call method on each of them. Object helps in that sort of communication.

  • @analogylibrary
    @analogylibrary 6 років тому

    From where can I get the full document which you are going through in the video?

    • @Lucasevsky85
      @Lucasevsky85 6 років тому

      He does courses on Udemy , I got a few for discounted price and they are very good :)

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

    Hi I was 70k th sub can I win prize? I like your videos thanks!

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

    moving screen up and down is very annoying. need to focus on presentation more

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

    @21:45 you have called wait method as Thread.wait(); which is incorrect wait method belongs to Object class not to Thread class

  • @DevendraKumar-hc7qm
    @DevendraKumar-hc7qm 5 років тому

    Exaplaination is not good

  • @arvindraju1990
    @arvindraju1990 4 роки тому +5

    Where we can find your generics exercises code which you mentioned in Video? on GIT HUB?