I have a requirement wherin i have a timer which raises events in a timespan of 5 milliseconds..and i have got a pice of code in the timercallback which basically retrieves data from the database,updates a dictionary and gives it back to the UI for processing.

Since the timeout is for 5 milliseconds,before finishing with the data loading part multiple threads seems to access the critical section(fetching data and updating dictionary) of the code.So,i did put a lock on the critical section and it works.But,my requirement is that i have to show the latest data on to the GUI,so i can ignore all the threads which are waiting on the lock till the lock aquired thread finishes processing.How should i tell all the threads which are waitng on a lock,not to wait on it but rather die itself??