how threads working ? RRS feed

  • Question

  • Hello All  , 

    if i have a method and assigned it to a thread 

    this method calls another methods in its body 

     , if i start another thread with the same method 

    Is that may conflict the data used in the first thread and the other one ?

    in another way i want to know if the method in the first thread calls another method in its body , and another thread started with the same method ,

    are the two threads will work separately and each one use a copy of each method it use  ?


    Kareem Naguib
    Sunday, January 16, 2011 12:19 AM


  • local variables exist in stack frame and are not shared.  Fields would be shared
    Sunday, January 16, 2011 1:32 AM