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

  • SEARCH
  • Home
  • 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 280391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:06:53+00:00 2026-05-12T05:06:53+00:00

To our great surprise we found recently this . With SP1 for Windows 2003

  • 0

To our great surprise we found recently this. With SP1 for Windows 2003 Microsoft changed a way critical sections behave. Earlier threads wanting to access them were served in FIFO manner. Right now they are served in pure “random” way.

In our case we had something like this:

// I now it's kind of ugly design but works
void Class:RunInThread()
{
   while(m_Running)
   {
       EnterCriticalSection(&m_CS);
       DoSomeStuffWithList();
       LeaveCriticalSection(&m_CS);
   }
} 
void Class::AddToList()
{
       EnterCriticalSection(&m_CS);
       AddSomeStuffToList();
       LeaveCriticalSection(&m_CS);
}

So with new implementation of critical section in 2003 SP2 AddToList might die in starvation since there is no guarantie that it will be awaken.

This example is a little bit extreme but on the other hand I have millions lines of code that were written with assumption that access to critical sections is serialized.

Is there a way to turn off this new critical section?

EDIT: Since getting back old version is not possible I am thinking of just doing global Search&Replace to change {Enter,Leaver}CriticalSection into something like My{Enter,Leave}CriticalSection. Have you ideas how this should be implemented so it behaves exactly like pre-SP2 version ?

  • 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. Editorial Team
    Editorial Team
    2026-05-12T05:06:53+00:00Added an answer on May 12, 2026 at 5:06 am

    That’s a known problem: http://www.bluebytesoftware.com/blog/PermaLink,guid,e40c2675-43a3-410f-8f85-616ef7b031aa.aspx Unfortunately the only way appears to be is to structure code such that it spends less time in critical section.

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

Sidebar

Related Questions

Subversion is a great way to update our web applications on our servers. With
One of our critical company apps (C#) crunches hi-rez images, and we've made great
We've been working on implementing timezone support for our Web app. This great SO
I have found many great answers to this from a year ago (when it
We've been using Jersey for our webservice and it's been great and straightforward. Is
I've got some code here that works great on IPv4 machines, but on our
I'm looking at using less . js (looks great), but our site requires that
Our server side validation (via data annotations) is working great and posts the errors
we have a great deal of PDF content on our site. I have some
Recently, we received a bug report from one of our users: something on the

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.