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 1012855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:00:33+00:00 2026-05-16T10:00:33+00:00

The Windows NT operating system has the EnterCriticalSection and ExitCriticalSection objects to allow for

  • 0

The Windows NT operating system has the EnterCriticalSection and ExitCriticalSection objects to allow for synchronization between threads.

What is the Linux equivalent, while using the GCC compiler?

I see references around to __sync_synchronize along with __scoped_lock

In fact I see mention of a number of atomic __sync functions along with a number of
__atomic ones.

I actually have been using __sync_fetch_and_add for my atomic increment
Should I be using __atomic_add_dispatch instead?
What’s the difference?

Which ones should I be using? Are there some constructs in C++ that I can use in both the latest version of GCC and Visual C++ 2010 that are available as I’m going to be writing some cross platform code.

I see boost has some functions available, but for various reasons I’m not allowed to use boost under windows.

  • 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-16T10:00:34+00:00Added an answer on May 16, 2026 at 10:00 am

    On Linux (and other Unixen) you need to use PThreads, or Posix Threads. There is no equivalent to Critical Sections on Windows; use a Mutex instead.

    EDIT: See first comment below — apparently Posix Mutexes are the same as Win32 Critical Sections in that they are bound to a single process.

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

Sidebar

Related Questions

Problem: I am using Windows as a guest operating system in a Virtual Machine
Is there a way in Windows/Linux or any other operating system to know at
The Free MS Windows replacement operating system ReactOS has just released a new version.
In windows operating system, the stack memory is a thread-specific storage, and the call
I have a 64 bit windows operating system and I use VS2008 to write
Context Language: C# Platform Version: Microsoft .Net Framework 4.0 Operating System: Windows 7 Professional
I just upgraded my operating system to Windows 7. Visual Studio 2008 also seems
I am running into trouble given the following setup: Operating System is Windows 7
In a Windows operating system with 2 physical x86/amd64 processors (P0 + P1), running
I like the Linux operating system and vim editor, but there are many companies

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.