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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:53:15+00:00 2026-05-30T16:53:15+00:00

I want to synchronize two threads. At the moment i am using double rotating

  • 0

I want to synchronize two threads. At the moment i am using double rotating dirty buffers that swap with a lock.

However it occurred to me i am only doing this to prevent dirty data from a write happening at the same time as a read. Can i store a flag in the most significant bit to convey data? or can i even go as far as whole byte.

For instance i can have an array of these and convey a lot of information in the form of bools. Reading and Writing is thread safe because the hardware can not read and write a single bit at the same time. So no garbage data.

Is this feasible? Is this the whole notion of atomic types.

  • 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-30T16:53:17+00:00Added an answer on May 30, 2026 at 4:53 pm

    Yes I think that could work, when testing your flags you would want to do an atomic test and set or compare and swap operation to set the flag indicating a write was occuring. You would need to make sure you the appropriate keyword in your language (e.g. volatile or atomic possibly), or use some OS provided compare and swap functionality. Have a look at this for a good example:

    http://drdobbs.com/embedded-systems/210604448?pgno=1

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

Sidebar

Related Questions

I want to synchronize one queue among two threads. Such as one thread performs
I have two threads that want to synchonize on the same object. Thead A
I want to use rsync to synchronize two directories in both directions. I refer
hi i am newbie to javascript.... i want to synchronize scrolling of two select
I have two threads, one that dispatches messages and another that parses them. Simple,
I want to synchronize two arrays. First array: 'hi' => Hello, 'bye'=> Bye bye,
I am trying to synchronize two thread (working on the same C++ map) using
I have two threads, and I want to make sure I am doing the
I'm using jQuery $.when function to synchronize two $.getJSON asynchronous calls I have. Merging
I had a 2x2 array that I had two threads operating on. it is

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.