Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 56433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:32:01+00:00 2026-05-10T17:32:01+00:00

I have some problems on a site with the concurrent access to a list.

  • 0

I have some problems on a site with the concurrent access to a list. This list keeps a cart of items, and multiple deletes are crashing the site. Which is the best method to sync them? Is a lock enough? The lock option seems to be ugly because the code is spread all over the place and is pretty messy.

Update: This is a list implemented like this: public class MyList : List< SomeCustomType> { }

This is a legacy site so not so many modifications are allowed to it. How should I refactor this in order to safely lock when iterating over it ?

any idea!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T17:32:02+00:00Added an answer on May 10, 2026 at 5:32 pm

    So is this in-memory list shared between requests? That sounds like a potential cause of problems even when you’ve got locking. Mutable shared collections should generally be avoided, IME.

    Note that if you do decide to synchronize, you’ll need to do things like locking the list for the whole course of iterating over it and other compound operations. Just locking on each specific access isn’t good enough.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 62k
  • Answers 62k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer In UTF-32 a unicode character would always be represented by… May 11, 2026 at 10:04 am
  • added an answer You want window.opener not window.parent (that's for frames). May 11, 2026 at 10:04 am
  • added an answer byte[] binaryData = Convert.FromBase64String(bgImage64); BitmapImage bi = new BitmapImage(); bi.BeginInit();… May 11, 2026 at 10:04 am

Related Questions

I have some problems on a site with the concurrent access to a list.
I have a very interesting problem on my LinqToSql model. On some of my
I have a problem, and was hoping I could rely on some of the
I have some problems with Miktex installed on Windows Vista Business SP1/32 bit. I
I have only installed Ruby1.9 on my machine. Have some kind of problems with
I've some CSS problem in Firefox 3. I have several image buttons on my
I need some ideas on how I can best solve this problem. I have
I am very new to C and I have some problems learning about pointers.
I have been having some problems trying to get my PHP running. When I
I have just started learning Erlang and am trying out some Project Euler problems

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.