c# - List with items in the last hour -
I am assuming logging for a list type structure in memory, and only items collected within the last hour Would like to keep This is in an asp.net mvc app, so the list is stable and access by multiple threads. I am currently checking every 80 minutes and will only remove people over 60 minutes (just because it has not been done on every request). I have a lock around the code that runs through the structure to find the old values, takes them to the temporary holder, then they are removed from the original structure.
I think there are some locking issues with this, so if there is any built-in structure or some bulletproof code that will help me do this, try to take the code in your hands Was eager for. .
As you say that you are "logging" in your list, it seems that
If so, then just use one. This removes the need for locking, and its
represents a moment-in-time snapshot of the content of the queue. Once known as GetEnumerator, it does not display any update of the archive. The calculator writes in the queue and writes it is safe to use concurrently.
The calculator returns the collection element in that order in which they were added, which is the fifo order (first-in, first-out)).
Comments
Post a Comment