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 HACK Google Play Music App

How to get BookMyShow Instant Disco...

How To Get Free Recharge And Money ...
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 ...
  • Hands-on with the home windows 10 Creators update for the Xbox One: Beam recreation streaming arrives
    The Windows 10 Creators Update is here, now—yes,  now —but not (officially) on the PC. The ...
  • Taotronics TT-BH22 Headphones Review
    We make it a addiction to now not look up pricing of a product sooner than reviewing and if ...
  • Pentagon strongly condemns North Korea missile test
    The Pentagon on Monday strongly condemned North Korea’s latest missile test, adding that the ...
  • Bank wallets growing faster than e-wallets
    In the  bank  versus  e-wallets  sweepstakes,  lenders  have now gained lost ground. As of ...
  • Facebook co-founder learned programming language in 2 days www.goandroidapps.in
    Facebook co-founder learned programming language in 2 days www.goandroidapps.in
    Facebook co-founder learned programming language in 2 days:  Learning an entire programming ...

Random Posts

  • Online daters likely to contact partners with similar education level: Study
    Online daters likely to contact partners with similar education level: Study
    16.01.2017 - 0 Comments
    MELBOURNE: Online daters are most likely to contact people with the same level of education as them,…
  • Sony Xperia XZ Premium Review
    Sony Xperia XZ Premium Review
    16.08.2017 - 0 Comments
    Sony Xperia XZ Premium is the second smartphone from the company after the Sony Z5 Premium to sport a…
  • Work smart: 10 tips that will make you Gmail expert
    Work smart: 10 tips that will make you Gmail expert
    14.02.2017 - 0 Comments
    Let's face it, Google today is synonymous with  internet.  With its numerous online services,…
  • India's mobile phone enterprise pass Trai in opposition to mandatory mobile GPS
    India's mobile phone enterprise pass Trai in opposition to mandatory mobile GPS
    02.04.2017 - 0 Comments
    India’s mobile phone industry has written to the telecom regulator, asking it to tell the telecom…
  • Nokia 8 starts receiving Android 8.1 Oreo
    Nokia 8 starts receiving Android 8.1 Oreo
    15.02.2018 - 0 Comments
    Nokia 8 has started receiving Android 8.1 Oreo update. Nokia 8 has started…

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

  • Steam Now Supports PS4's DualShock 4 Controller
    HIGHLIGHTS ...
  • This $15 stand turns your Apple Watch into a mini Macintosh
    For all those  ...
  • MobiKwik - Update E-KYC & Get Rs. 100 Supercash
    MobiKwik - Update E-KYC & Get Rs. 100 Supercash
    Mobikwik - Update ...
  • Fitbit Flex 2017 review
    Fitbit PROS ...
  • (Redeem Now) Download MobileXpression App And Get Rs 300 Jabong Voucher Latest Feb 2016
    MobileXpression app ...
  • Lenovo HW02 Plus fitness band Review
    Lenovo HW02 Plus ...
  • New Samsung Galaxy S7 EDGE Review: Still The Best-Looking Android Around
    In the mobile ...

Random Posts

  • Eleven-year-old root flaw found and patched in the Linux kernel
    Eleven-year-old root flaw found and patched in the Linux kernel
    23.02.2017 - 0 Comments
    Linux system administrators should be on the watch for kernel updates because they fix a local privilege…
  • Nokia 3310 4G variant with Android-based YunOS launched
    Nokia 3310 4G variant with Android-based YunOS launched
    30.01.2018 - 0 Comments
    Nokia 3310 4G has been made launched, featuring an ultra-fast 4G LTE connectivity and Wi-Fi…
  • YouTube launches streaming TV service with 40 channels and unlimited cloud DVR storage
    YouTube launches streaming TV service with 40 channels and unlimited cloud DVR storage
    01.03.2017 - 0 Comments
    If you’ve been on the fence over cutting the cord, YouTube might have just given you a reason to jump…
  • Coolpad Note 5 review
    Coolpad Note 5 review
    23.03.2017 - 0 Comments
    Coolpad Note 5 sports a metal unibody design and the smartphone has impressive specifications on…
  • 11.02.2016 - 0 Comments

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!