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

  • Remove items from the front
  • Repeat it
  • Remove all items from the list
  • Performance (I suppose "some locking issues" means poor performance)
  • 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

    Popular posts from this blog

    apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

    c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

    c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -