• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Regarding synchronization?

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,query as follows.
I have a one function which is public static void func_name().

Inside the function,
there are three steps.

for each step i.e step1 thred1 a[i]= new thred1[4]; //
a[i]= new thred1(var);

step2. thred2 b[]= new thred2[4];//declare inside constructor
b[i]= new thred2(var);

step3. thread3 c[]=new thread3[4];
c[i]=new thread3(var);

This function is static as well as ,
these are also static means somethin like this

static class thred1 extends Thread{
int var1;
thred1(int var1){this.var1=var1;}
public void run(){
}
}

suppose function is called in very small interval(function is synchronized also and it is static) ,
so is there any chance of var1 getting changed.

do reply.
regards
sachindra
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I didn't quite understand your question. It would be simpler if you just posted your complete code and asked a specific question regarding it. You can use [CODE] markups for that.
 
He's giving us the slip! Quick! Grab this tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic