Giter VIP home page Giter VIP logo

raklibipc's Introduction

RakLib IPC

This project provides utilities and protocols for interacting with RakLib via message-based channels.

The library defines the following interfaces which must be implemented:

  • InterThreadChannelReader
  • InterThreadChannelWriter

The method of transmitting messages is up to you - it could use sockets, pthreads Threaded objects, parallel Channel, or anything else.

raklibipc's People

Contributors

0x15f avatar alejandroliu avatar boi1216 avatar dependabot-preview[bot] avatar dependabot[bot] avatar dktapps avatar falkirks avatar frago9876543210 avatar humerus avatar intyre avatar shoghicp avatar sof3 avatar svilex avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

raklibipc's Issues

Give each session its own inter-thread communication channels

Currently RakLib uses two global channels for inter-thread communication (one for each direction).

These global channels are a major bottleneck for RakLib scaling because every packet sent or received from any session passes through these channels. This has two effects:

  • Frequent lock contention: it's likely that contention for mutex locking will occur when pushing stuff into channels while the other thread is trying to pull it out.
  • Inability to use multiple CPU cores: these central channels are a big showstopper for parallel scaling, because inevitably worker threads would end up contending for locks on the channels with other worker threads.

This issue proposes that each RakLib session should have its own ITC channel pair. This may be tricky to implement due to pthreads stupidity, but in terms of code complexity it's simple and effective.

Basically impossible to request data from the RakLib thread

The current design restricts the use of the inter-thread messaging to just sending instructions back and forth. It's not possible for the user thread to, for example, request statistics for a particular session to be returned to the main thread, without modifications to RakLib itself.

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.