K
Kejpa
Hi,
I'm logging the values my app is producing, in order to keep the logs small
I zip them hourly.
My problem lies in that two (or more) different objects discover that the
hour has changed and each tries to start a thread to create the hourly zip.
The runner up discovers that there is no file and creates it, but during
this time the first thread already has created the file and I get an "File
already exists"-error.
Basically, I want the object that first discovers a change of hour to start
a single thread where the zip occurs. The runner up object should notice
that the thread is started/zip exists and just add the previous log file to
the zip.
TIA
Kejpa
I'm logging the values my app is producing, in order to keep the logs small
I zip them hourly.
My problem lies in that two (or more) different objects discover that the
hour has changed and each tries to start a thread to create the hourly zip.
The runner up discovers that there is no file and creates it, but during
this time the first thread already has created the file and I get an "File
already exists"-error.
Basically, I want the object that first discovers a change of hour to start
a single thread where the zip occurs. The runner up object should notice
that the thread is started/zip exists and just add the previous log file to
the zip.
TIA
Kejpa
