All Projects → PlatformLab → Arachne

PlatformLab / Arachne

Core aware thread management system

Labels

Projects that are alternatives of or similar to Arachne

Vs Threading
The Microsoft.VisualStudio.Threading is a xplat library that provides many threading and synchronization primitives used in Visual Studio and other applications.
Stars: ✭ 585 (+230.51%)
Mutual labels:  threading
Porcupine
Threading, Resiliency and Monitoring for Java EE 7/8
Stars: ✭ 99 (-44.07%)
Mutual labels:  threading
Floyd
The Floyd programming language
Stars: ✭ 133 (-24.86%)
Mutual labels:  threading
Transient
A full stack, reactive architecture for general purpose programming. Algebraic and monadically composable primitives for concurrency, parallelism, event handling, transactions, multithreading, Web, and distributed computing with complete de-inversion of control (No callbacks, no blocking, pure state)
Stars: ✭ 617 (+248.59%)
Mutual labels:  threading
Multitasking
Non-blocking Python methods using decorators
Stars: ✭ 87 (-50.85%)
Mutual labels:  threading
Tweet Locator
Tweet locator using Python, Flask and Twitter API
Stars: ✭ 105 (-40.68%)
Mutual labels:  threading
Onioff
🌰 An onion url inspector for inspecting deep web links.
Stars: ✭ 440 (+148.59%)
Mutual labels:  threading
Mcmap
Pixel-art map visualizer for Minecraft. Maps are drawn from an isometric perspective.
Stars: ✭ 165 (-6.78%)
Mutual labels:  threading
Tutorials
机器学习相关教程
Stars: ✭ 9,616 (+5332.77%)
Mutual labels:  threading
Threadboat
Program Uses Thread Execution Hijacking To Inject Native Shell-code Into a Standard Win32 Application
Stars: ✭ 132 (-25.42%)
Mutual labels:  threading
Asyncawaitbestpractices
Extensions for System.Threading.Tasks.Task and System.Threading.Tasks.ValueTask
Stars: ✭ 693 (+291.53%)
Mutual labels:  threading
Likwid
Performance monitoring and benchmarking suite
Stars: ✭ 957 (+440.68%)
Mutual labels:  threading
Open.channelextensions
A set of extensions for optimizing/simplifying System.Threading.Channels usage.
Stars: ✭ 106 (-40.11%)
Mutual labels:  threading
Wrmhl
⚡️ Super fast communication beetwen Unity3D and Arduino. Create Interactive experiences in a minute ⏱
Stars: ✭ 601 (+239.55%)
Mutual labels:  threading
Physac
2D physics header-only library for videogames developed in C using raylib library.
Stars: ✭ 151 (-14.69%)
Mutual labels:  threading
Comlink Loader
Webpack loader to offload modules to Worker threads seamlessly using Comlink.
Stars: ✭ 535 (+202.26%)
Mutual labels:  threading
Python Examples
Python examples from my answers on Stackoverflow and other short scripts.
Stars: ✭ 101 (-42.94%)
Mutual labels:  threading
Pht
A new threading extension for PHP
Stars: ✭ 175 (-1.13%)
Mutual labels:  threading
Microjob
A tiny wrapper for turning Node.js worker threads into easy-to-use routines for heavy CPU loads.
Stars: ✭ 1,985 (+1021.47%)
Mutual labels:  threading
Agency
Execution primitives for C++
Stars: ✭ 127 (-28.25%)
Mutual labels:  threading

Arachne: Towards Core-Aware Scheduling

What is core aware scheduling?

In today's large-scale data center systems, there are many complex software components which make a binary trade-off between latency and throughput. They either overprovision their systems to obtain lower latencies and consequently waste resources, or oversubscribe their systems and experience very high latencies due to imbalance between application load and system resources.

Core-aware scheduling is the notion that we can balance an application's offered load to a system's available resources by scheduling threads at user level, and performing coarse-grained core allocation at operating system level.

Under this approach, the kernel no longer preemptively multiplexes between threads without any awareness of what the application is doing. This enables us to avoid the performance degradations caused by slow context switches, priority inversion, and cache pollution from the threads of other processes.

What is Arachne?

According to Greek mythology, Arachne was a mortal weaver who challenged the goddess Athena to a weaving competition. Similarly, the Arachne user threading system attempts to challenge the current dominance of kernel threads in the C++ world.

Arachne is the first step towards core-aware scheduling, allowing an application to run only as many threads in parallel as cores available to it.

Arachne is a user-level, cooperative thread management system written in C++, designed to improve core utilization and maximize throughput in server applications without impacting latency. It performs M:N scheduling over kernel threads running exclusively on CPU cores and features ~200 ns cross-core thread creations and ~100 ns cross-core signals on Nehalem X3470. Arachne also estimates CPU load and adjusts the number of cores accordingly.

How do I use it?

  1. Recursively clone Arachne super repository.

     git clone --recursive https://github.com/PlatformLab/arachne-all.git
    
  2. Build the library with ./buildAll.sh in the top level directory.

     cd arachne-all
     ./buildAll.sh
    
  3. Write your application using the public Arachne API, documented here.

    #include <stdio.h>
    #include "Arachne/Arachne.h"

    void numberPrinter(int n) {
        printf("NumberPrinter says %d\n", n);
    }

    // This is where user code should start running.
    void AppMain(int argc, const char** argv) {
        printf("Arachne says hello world and creates a thread.\n");
        auto tid = Arachne::createThread(numberPrinter, 5);
        Arachne::join(tid);
    }

    // The following bootstrapping code should be copied verbatim into most Arachne
    // applications.
    void AppMainWrapper(int argc, const char** argv) {
        AppMain(argc, argv);
        Arachne::shutDown();
    }
    int main(int argc, const char** argv){
        Arachne::init(&argc, argv);
        Arachne::createThread(&AppMainWrapper, argc, argv);
        Arachne::waitForTermination();
    }
  1. Link your application against Arachne.

     g++ -std=c++11 -o MyApp MyApp.cc  -Iarachne-all/Arachne/include -Iarachne-all/CoreArbiter/include  -Iarachne-all/PerfUtils/include -Larachne-all/Arachne/lib -lArachne -Larachne-all/CoreArbiter/lib -lCoreArbiter -Larachne-all/PerfUtils/lib/ -lPerfUtils  -lpcrecpp -pthread
    

User Threading vs Kernel Threadpool

For those who are unfamiliar with the benefits of user threading, it may seem that a simple kernel thread pool would achieve the same result as a user threading library. However, tasks running in a kernel thread pool generally should not block at user level, so they must run to completion without blocking.

Here is an example of a use case that would require manual stack ripping in a thread pool, but could be implemented as a single function under Arachne.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].