Git Product home page Git Product logo

Comments (6)

skliper avatar skliper commented on July 22, 2024

Imported from trac issue 15. Created by jphickey on 2014-12-30T22:23:15, last modified: 2019-03-05T14:58:28

from cfe.

skliper avatar skliper commented on July 22, 2024

Trac comment by glimes on 2016-11-08 14:17:08:

Current crop of cfe-next are all going into CFE 6.6

from cfe.

skliper avatar skliper commented on July 22, 2024

Trac comment by jphickey on 2017-10-16 13:47:18:

This is currently in progress and it depends on #74 being fixed first.

The issue described here is related to reading the reference time by other threads. The protection is inadequate and allows a ready to get a partially updated object. However, the "garbage in garbage out" rule applies, there are deeper issues related to updating the shared object in the first place. Once the writers are synchronized, then the issue of readers can be addressed.

from cfe.

skliper avatar skliper commented on July 22, 2024

Trac comment by jphickey on 2017-10-16 14:39:46:

CONFIRMED ISSUE

I have confirmed I am able to produce this issue in the real system by subscribing to the "1Hz" MID in an app, and calling CFE_TIME_GetUTC() within that handler. Sometimes this comes back with bad UTC information.

Note in order to //identify// when the UTC information is bad, it required a bit of a hack to the update code to first "poison" the global MET value before writing the correct value in the global variable. If it gets returned from CFE_TIME_GetRefence(), the poisoned MET value then creates an incorrect UTC conversion, which is in turn identifiable in the application.

This proves that applications can indeed read the MET during update, even though the updater thread runs at a higher priority than the reader thread.

from cfe.

skliper avatar skliper commented on July 22, 2024

Trac comment by jphickey on 2017-10-17 14:56:46:

Note - it was easier to include a patch for the CFE_TIME_GetReference() in with the rest of the changes for #74, rather than keeping it a separate changeset.

The fix is to keep two version counters, instead of just one. The "pending" counter is incremented before any changes start, and the "complete" counter is incremented when all changes are complete. A reader task then samples them in the //opposite// order, where the "complete" version counter is read before any copying, and then it is checked against the "pending" counter after copying is complete. If these values are equal, then the copied data can be trusted. If they are not equal, then it must be retried.

This "version" paradigm was preserved (rather than using a lock) since it allows multiple reader tasks to execute concurrently, but a mutex lock would force all reader threads to be serialized, negatively affecting performance.

Testing with the #74 fix, no corrupt UTC samples were observed using the same "stress test" approach described in my previous comment. Therefore nothing more beyond the fix for this other ticket needs to be done.

from cfe.

skliper avatar skliper commented on July 22, 2024

Trac comment by jhageman on 2019-03-05 14:58:28:

Milestone renamed

from cfe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.