View Single Post
  #1  
Old January 6th 17, 12:57 AM posted to alt.windows7.general
Asger Joergensen
external usenet poster
 
Posts: 92
Default A queue of jobs / threads


Hi

I have a situation where jobs comes in from several computers
adding, updating or deleting items in a vector these jobs are
done by threads, but very fast and they are synchronized with
the main thread at the point where they update the vector.

Each time the vector is updated I must save the data to disk and
I do so in a thread, the saving is very slow compared to the other
jobs, so there might very well be a bunch of saving threads waiting
for file access and only the last one will end up saving an updated
vector.

I would of course like to only run the last thread, so my question
is what is the normal way to deal with this situation ??

Thanks in advance
Best regards
Asger
Ads