Giter Site home page Giter Site logo

Comments (9)

nox avatar nox commented on July 22, 2024

I'm pretty sure you are supposed to be able to send and recv on the same thread.

from ipc-channel.

vvuk avatar vvuk commented on July 22, 2024

The big_data test at https://github.com/servo/ipc-channel/blob/master/src/platform/test.rs#L128 explicitly makes a new thread to do the large send; if it didn't, it will likely deadlock as the others do. On linux, pipe capacity is 65536, and OSX apparently can switch to that too if large writes are made. But in both cases they can both drop down if too much memory is in use by kernel buffers.

from ipc-channel.

emilio avatar emilio commented on July 22, 2024

Yeah, I think that same-thread sends and recvs shouldn't be allowed. Ideally this would be enforced, but this is hard.

I wonder if Servo uses that a lot... I hope not, but...

from ipc-channel.

antrik avatar antrik commented on July 22, 2024

@vvuk I think the idea was that the "medium_data" test is supposed to be somewhat large, but small enough not to cause fragmentation and thus blocking. (Note that the linux backend uses sockets, not pipes -- and in my testing, the buffer size never drops below 104 KiB IIRC, even on serious memory pressure...)

What sizes are we talking about specifically? If it's not way smaller than 64 KiB, we could simply modify the medium_data test to stay below the limit...

As for the API, I introduced platform::OsIpcSender::get_max_fragment_size() for the benefit of the test cases -- not sure how "official" this should be considered...

from ipc-channel.

antrik avatar antrik commented on July 22, 2024

@vvuk since your current implementation seems to pass the tests just fine, I assume this is no longer an issue?...

from ipc-channel.

vvuk avatar vvuk commented on July 22, 2024

Correct, but it only passes the tests since I chose a big enough buffer
size :)

On Oct 19, 2016 6:50 PM, "Olaf Buddenhagen" [email protected]
wrote:

@vvuk https://github.com/vvuk since your current implementation seems
to pass the tests just fine, I assume this is no longer an issue?...


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#101 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAL5lXs4ALmfkR8IuYOvXcBK0k6_ZNmNks5q1p6sgaJpZM4J8_us
.

from ipc-channel.

antrik avatar antrik commented on July 22, 2024

@vvuk and you consider that a problem?...

from ipc-channel.

vvuk avatar vvuk commented on July 22, 2024

It's potentially surprising behaviour for a consumer of the library. They can write code like:

let (tx, rx) = channel();
tx.send(data);
let data1 = rx.recv().unwrap();

that will work fine until data.len() crosses over a threshhold. But given that there's probably code out there that already depends on this... not sure there's much we can do other than document and require that, say, buffer size is (at least) 64kb, and promise only 64kb.

from ipc-channel.

antrik avatar antrik commented on July 22, 2024

from ipc-channel.

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.