|
RE: Reloading thread variables: msg#00017java.jsr.166-concurrency
Jean, This seems like excessive micro-optimization. Write the class using a volatile and see if there is a performance problem. If so then try to figure out ways of dealing with it. > So, when the field value change, I'm wondering if restarting all threads > (stoping live threads and creating new ones) that use this class would > ensure that they see the new field value? If yes, I will not be forced > to declare the field volatile (thus no overhead). If the pattern is: changeValue(int newval) { stopAllThreadsButMe(); val = newval; startNewThreads(); } then yes the new threads will all see the new value. But the implied thread management here would seem to impose its own significant overhead. And it assumes you can stop all threads etc. David Holmes
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Reloading thread variables, Jean Morissette |
|---|---|
| Next by Date: | backport-util-concurrent: new release available, Dawid Kurzyniec |
| Previous by Thread: | Reloading thread variables, Jean Morissette |
| Next by Thread: | backport-util-concurrent: new release available, Dawid Kurzyniec |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |