GithubHelp home page GithubHelp logo

otuncer / thread_count_sparc Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 0 B

Records the number of running and runnable threads on SPARC architecture running Solaris 10 with down to 1ms sampling period.

Makefile 3.43% C 80.55% Shell 7.61% C++ 8.41%

thread_count_sparc's Introduction

thread_count_sparc

Records the number of running and runnable threads on SPARC with Solaris 10 with down to 1ms sampling period. Run runme.sh with root user.

--- How it works:

All tunables and constants are defined in constants.h

Kernel module: The kernel module counts the number of threads by looking at each CPUs dispatcher length and active thread. The total number is recorded in a ring buffer with size THR_CNT_AR_SIZE every THR_CNT_SAMPLING_PERIOD_NS. The recording starts and stops when a dummy write to the module is issued. The dummy write is issued by the runme.sh script. The kernel module copies the recorded numbers to the read buffer in the read() call in chunks of 1/4th of the ring buffer.

User program: The user module attempts to read the entire record (duration is given to runme.sh as an argument) from the kernel module at a single read system call and waits.

Granularity: The program consumes two threads that do not get blocked unless the scheduler forces them to (this happens if the system is overloaded). Blocking causes the recording to suspend for at least 10ms, which is the solaris scheduler tick. Busy polling with two threads is not a problem as the SPARC CPUs have 128+ hardware threads.

thread_count_sparc's People

Contributors

otuncer avatar

Stargazers

Kevin Hatfield avatar

Watchers

 avatar

Forkers

cloudxtreme

thread_count_sparc's Issues

Unnecessary busy polling

The user thread can sleep instead of waiting through busy polling. This will not change the granularity.

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.