Git Product home page Git Product logo

Comments (3)

cheatfate avatar cheatfate commented on June 23, 2024

On my experiments both socketpair and pipe provides same performance and sometimes socketpair is better. The only reason to choose socketpair is that its possible to do read(MSG_PEEK) to check if data is available in socket, there is no way to perform this check on pipe, but it is required for this implementation. Also i know that its not that performant as on Linux/Windows, but at least it is present.
EVFILT_USER was interesting case, but it only supported by FreeBSD and NetBSD, while OpenBSD, DragonflyBSD and MacOS do not support this functionality.

from nim-chronos.

cheatfate avatar cheatfate commented on June 23, 2024

Sorry, looks like it is present in MacOS but its undocumented.

from nim-chronos.

elcritch avatar elcritch commented on June 23, 2024

On my experiments both socketpair and pipe provides same performance and sometimes socketpair is better. The only reason to choose socketpair is that its possible to do read(MSG_PEEK) to check if data is available in socket, there is no way to perform this check on pipe, but it is required for this implementation.

Nice! Good to know as I wasn't sure how they compared.

EVFILT_USER was interesting case, but it only supported by FreeBSD and NetBSD, while OpenBSD, DragonflyBSD and MacOS do not support this functionality.

Yah I think MacOS and FreeBSD make up a fair bit of the "market share" for development or servers, respectively, for BSD's.

Sorry, looks like it is present in MacOS but its undocumented.

Yah odd it's not in the man page. One stackoverflow thread said it has been available since macos 10.6. Though I suspect Apple wants most developers to use Grand Central Dispatch rather than the raw mechanisms.

Looks like libevent uses it as well. The main thing I noticed with it was a bit of latency improvement.

I might try and make a PR at some point, as I'll be using the asynchronous thread notification and develop on Mac. :)

from nim-chronos.

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.