The Artima Developer Community
Sponsored Link

Java Answers Forum
Multi-Threading and counters question

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
GunNam

Posts: 6
Nickname: gunnam
Registered: Mar, 2002

Multi-Threading and counters question Posted: Mar 22, 2002 4:07 AM
Reply to this message Reply
Advertisement
Say you have 5 shopping customers (5 Threads), 3 register lines.

I want to initialize register lines to 0 when the first customer begins to shop.

But after that customer, I want to keep the running count on the registers.

How can I do this? If I put the Register lines counters at the beginning of the code, every time that thread is started, Register Line counters will be set to 0. How can I update it with the latest Register Counter count? Where should I initilize the counters, in another class, then call getRegisterCount?

Topic: System time in nanoseconds Previous Topic   Next Topic Topic: Connect4 HELP HELP HELP

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use