Coder Social home page Coder Social logo

Comments (3)

xtaci avatar xtaci commented on August 30, 2024

I was aware this issue, and it can be easily fixed.

let us think for another question: under which scenario it sounds reasonable for 2 concurrent writers to write on a single stream, assume there is a condition where 2 concurrent writer exists, can they split into two streams?

from smux.

xtaci avatar xtaci commented on August 30, 2024

Actually, concurrent writing on a single connection leads to indeterministic frame interleaving, I may write a comment for Write() function to state that issue.

And for this particular issue, I just replaced with atomic ops to suppress the error(not to fix).

from smux.

Eudi4H avatar Eudi4H commented on August 30, 2024

let us think for another question: under which scenario it sounds reasonable for 2 concurrent writers to write on a single stream, assume there is a condition where 2 concurrent writer exists, can they split into two streams?

I agree, the situation is a little unnatural. In my case, it was in a test program (an echo server), where one goroutine was echoing input, and another goroutine was sending a periodic heartbeat message. I can easily redesign the program to avoid concurrent writes. I mention this only because the contract for net.Conn says "multiple goroutines may invoke methods on a Conn simultaneously."

Anyway thanks, 182ea54 makes the data race message disappear.

from smux.

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.