Android Century
  • Home
  • Android Zone
    • Android Apps
    • Android Games
    • Apps APk Files
    • Games Apk Files
    • Apps Hack Tricks
  • Reviews
  • Fantasy Zone
    • Entertainment
    • Quotes and Status
    • Life Style
    • Home Made Tips
    • Hair Care
    • Skin Care
    • Fantasy Tips
  • Tricks
    • Free Recharge
    • Free Internet
    • shopping Cashback
    • Recharge Cashback
  • Tech
  • Mobiles
  • Gadgets
  • News
  • How To's
  • Software
Breaking
Loading...

Featured post

How to Take Great Photos With Apple's iPhone X

Recent Posts

Labels

  • Android Apk Files
  • Android Apps
  • Android Games
  • Apps Apk Files
  • Entertainment
  • Fantasy Tips
  • Gadgets
  • Hair Care
  • HomeMade Tips
  • How To's
  • News
  • Quotes
  • Quotes & Status
  • Recharge Cashback
  • Recharge Promo Codes
  • Shopping Cashback
  • Technology
  • skin care
Home / How To's / When Is a CPU’s Cache Flushed Back to Main Memory?

When Is a CPU’s Cache Flushed Back to Main Memory?

Latest Govt. Jobs 16:46:00 How To's Edit
If you are just starting to learn how multi-core CPUs, caching, cache coherency, and memory works, it may seem a little bit confusing at first. With that in mind, today’s SuperUser Q&A post has answers to a curious reader’s question.
Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

The Question

SuperUser reader CarmeloS wants to know when a CPU’s cache is flushed back to main memory:
If I have a CPU with two cores and each core has its own L1 cache, is it possible that Core1 and Core2 both cache the same part of memory at the same time? If it is possible, what will the value of main memory be if both Core1 and Core2 have edited their values in cache?
When is a CPU’s cache flushed back to main memory?

The Answer

SuperUser contributors David Schwartz, sleske, and Kimberly W have the answer for us. First up, David Schwartz:
If I have a CPU with two cores and each core has its own L1 cache, is it possible that Core1 and Core2 both cache the same part of memory at the same time?
Yes, performance would be terrible if this was not the case. Consider two threads running the same code. You want that code in both L1 caches.
If it is possible, what will the value of main memory be if both Core1 and Core2 have edited their values in cache?
The old value will be in main memory, which will not matter since neither core will read it. Before ejecting a modified value from cache, it must be written to memory. Typically, some variant of the MESI protocol is used. In the traditional implementation of MESI, if a value is modified in one cache, it cannot be present at all in any other cache at that same level.
Followed by the answer from sleske:
Yes, having two caches cache the same memory region can happen and is actually a problem that occurs a lot in practice. There are various solutions, for example:
  • The two caches can communicate to make sure they do not disagree
  • You can have some sort of supervisor which monitors all caches and updates them accordingly
  • Each processor monitors the memory areas that it has cached, and when it detects a write, it throws out its (now invalid) cache
The problem is called cache coherency and the Wikipedia article on the topic has a nice overview of the problem and possible solutions.
And our final answer from Kimberly W:
To answer the question in your post’s title, it depends on what the caching protocol is. If it is write-back, the cache will only be flushed back to main memory when the cache controller has no choice but to put a new cache block in already occupied space. The block that previously occupied the space is removed and its value is written back to main memory.
The other protocol is write-through. In that case, anytime the cache block is written on level n, the corresponding block on level n+1 is updated. It is similar in concept to filling out a form with carbon paper underneath; whatever you write on top is copied on the sheet below. This is slower because it obviously involves more writing operations, but the values between caches are more consistent. In the write-back scheme, only the highest level cache would have the most up-to-date value for a particular memory block.

Have something to add to the explanation? Sound off in the comments. 
Share on Facebook Share on Twitter Share on Google Plus

RELATED POSTS


How To Get Free Recharge And Money ...

How to Sync Your Contacts Between A...

How to Know a Wi-Fi Network Is Fast...
When Is a CPU’s Cache Flushed Back to Main Memory? When Is a CPU’s Cache Flushed Back to Main Memory? Reviewed by Latest Govt. Jobs on 16:46:00 Rating: 5

0 comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments ( Atom )

Search This Blog

TEST BOOK FOR GOVT ENTRANCE TEST

TEST BOOK FOR GOVT ENTRANCE TEST
Find All Latest book for preparation of SSC,RAILWAYBANK PO,RBI,BANK CLERK,GATE ME,GATE CE are available here in less prices, to check out the books click here

Translate

  • Popular Post
  • Random posts
  • Category

Popular Posts

  • Teen Patti Offer 2018: Refer and Earn Flipkart Vouchers Free
    Teen Patti Offer 2018: Refer and Earn Flipkart Vouchers Free
    Teen Patti Refer & Earn Offer:  Hey Guys! Today I make an article about Teen Patti Referral ...
  • Taotronics TT-BH22 Headphones Review
    We make it a addiction to now not look up pricing of a product sooner than reviewing and if ...
  • Reliance Jio to offer sharp tariff discounts for customers signing up by March-end
    Reliance Industries' Jio unit will charge a tariff for its services from April, but will offer ...
  • Pentagon strongly condemns North Korea missile test
    The Pentagon on Monday strongly condemned North Korea’s latest missile test, adding that the ...
  • Fitbit Zip 2017 review
    Fitbit PROS: Clever, accurate tracking Expandable online service Integration with 3rd ...
  • Bank wallets growing faster than e-wallets
    In the  bank  versus  e-wallets  sweepstakes,  lenders  have now gained lost ground. As of ...

Random Posts

  • Here's How to properly add Twitter Cards in your Blogger and WordPress
    Here's How to properly add Twitter Cards in your Blogger and WordPress
    06.04.2017 - 0 Comments
    Twitter Cards can be understand easily if we compare these codes with Schema code that we add to optimized…
  • Android N developer preview: Top 10 new features of Google’s latest Android OS
    Android N developer preview: Top 10 new features of Google’s latest Android OS
    07.06.2016 - 0 Comments
    Google surprised everyone by announcing the release of the developer preview version of its latest…
  • 5 Steps to Get Creative Again
    5 Steps to Get Creative Again
    11.09.2016 - 0 Comments
    Each of us has a ‘creative bone’ in our body, even the ones who insist that they don’t. The only problem is…
  • How Do You Copy Deleted Text in Microsoft Word?
    How Do You Copy Deleted Text in Microsoft Word?
    19.02.2017 - 0 Comments
    Being able to have Microsoft Word track the changes you make as you go is great, but what do you do if…
  • Yemen truce raises hope of ending conflict
    Yemen truce raises hope of ending conflict
    08.04.2016 - 0 Comments
    Dubai: A new ceasefire enters into effect in Yemen midnight Sunday, with the United Nations hoping…

Labels

Android Apk Files Android Apps Android Games Apps Apk Files Apps Hack Tricks Entertainment Free Internet Freecharge Gadgets Games Apk Files How To's Laptops Guide Mobiles Reviews Technology Viral's android zone free recharge

Entertainment

Tricks

Popular Posts

  • Teen Patti Offer 2018: Refer and Earn Flipkart Vouchers Free
    Teen Patti Offer 2018: Refer and Earn Flipkart Vouchers Free
    Teen Patti Refer & ...
  • Taotronics TT-BH22 Headphones Review
    We make it a ...
  • Hands-on with the home windows 10 Creators update for the Xbox One: Beam recreation streaming arrives
    The Windows ...
  • Reliance Jio to offer sharp tariff discounts for customers signing up by March-end
    Reliance Industries' Jio unit will charge a tariff for its services from April, but will offer ...
  • Fitbit Zip 2017 review
    Fitbit PROS ...
  • Bank wallets growing faster than e-wallets
    In the  bank ...
  • Latest Blackberry KEYone on website, spills out price and other details
    China-based  ...

Random Posts

  • Sony Cybershot DSC HX350 camera review
    Sony Cybershot DSC HX350 camera review
    23.03.2017 - 0 Comments
    The Sony HX350 looks like any other bridge camera we have seen in recent times, and there have been a few of…
  • Samsung Galaxy J2 Pro, Galaxy J2
    Samsung Galaxy J2 Pro, Galaxy J2
    22.02.2018 - 0 Comments
    NEW DELHI: Samsung has slashed the price of its Galaxy J2 Pro and Galaxy J2 (2017) smartphones. The new…
  • POP3 vs. IMAP: Which protocol lets you get all of your email on any device
    POP3 vs. IMAP: Which protocol lets you get all of your email on any device
    12.02.2017 - 0 Comments
    Wayne Zimmerman’s wife usually reads email on her own PC. But when she tries to read it on her husband’s…
  • WhatsApp Enables Two-Step Verification in Android and Windows Beta Apps
    WhatsApp Enables Two-Step Verification in Android and Windows Beta Apps
    11.11.2016 - 0 Comments
    HIGHLIGHTS WhatsApp's new two-step verification is optional On Android, beta app users running v…
  • HONOR 8
    HONOR 8
    10.11.2016 - 0 Comments
    HONOR 8 SUMMARY The Honor 8 mobile features a 5.2 Inch display and runs on…

Most Popular

  • Teen Patti Offer 2018: Refer and Earn Flipkart Vouchers Free
    Teen Patti Offer 2018: Refer and Earn Flipkart Vouchers Free
    Teen Patti Refer & ...
  • SAMSUNG GALAXY J7 (2016) REVIEWS
    SAMSUNG GALAXY J7 (2016) REVIEWS
    SAMSUNG GALAXY J ...
  • Top 5 Best SmartPhones under 7000 Rs (March 2017)
    Looking for the ...
  • Apple, IBM, Cisco are huge because of Indians, do not deny them H-1B visa: RBI Governor Urjit Patel
    ...
  • SAMSUNG GALAXY J7 (2016) Specifications
    SAMSUNG GALAXY J ...
  • BlackBerry Teases Marshmallow Beta Testing for Priv by Next Week
    Blackberry ...
  • LG Q6 Review
    LG Q6 Review
    2017 is ...

Contact Form

Name

Email *

Message *

Offers Zone

Created By Android Century Distributed by Android Century
  • Home
  • About us
  • Contact us
  • Privacy policy
  • Terms of use
  • Advertise here
Subscribe Via Email Subscribe To Android Century By Email And Get Free Updates. ;-)


Your email address is safe with us!