• Post Reply Bookmark Topic Watch Topic
  • New Topic

transfer the value in threads  RSS feed

 
Steve Jiang
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
am changing the standard process to threads. Now I met the problem that threads need to read one global variable from static methods, as there is no stop, the global variable will be changed to the last value of flavor lists.

I consider to get the value of flavor from the first loop and transfer it into each thread, but I don't think start() or run (0 can pass parameter.

Any advice?

Thanks a lot


[CODE]
Loop for each flavor
Configurator.changeSiteFlavor( flavorId ); //Static method
Loop for each publish process
createClassAndCallPublish // Run each publish process, it is changed to threads, each threads will read globle Flavor. (each process will run 1 - 5 min depend on machine.)
end
end

[/CODE}
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start does not pass a parameter to run, but you can create a Runnable, configure it, hand it to a thread.

or

That will spawn some number of publisher threads for a color, wait for them all to end, then spawn the same number for the next flavor. Does that sound good?
[ August 16, 2004: Message edited by: Stan James ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!