Coder Social home page Coder Social logo

core_affinity_rs's People

Contributors

chiplis avatar elzair avatar figsoda avatar grembo avatar mottl avatar nau avatar nviennot avatar s1341 avatar stlankes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

core_affinity_rs's Issues

Merge back libafl/core_affinity eventually?

Just noticed this crate is still maintained, IIRC it felt a bit dormant for a while.
Since we needed new features, we forked this library and added support for a range of other OSses like dragonfly BSD, solaris and more, see here:
https://github.com/AFLplusplus/LibAFL/blob/main/libafl_bolts/src/core_affinity.rs

Apart from more OS support, we have also changed the API in some ways.
If there is some interest we could still try to merge the two libraries again?

Update Dependencies

Recently, GitHub CI started to warn, since this crates uses a rather old winapi version. Any chances to update the dependencies? Do you still accept PRs?

just a single cpu per thread?

Thanks for sharing this lib.

I'd like to suggest the possibility of setting the cpu affinity for more than 1 cpu.

(set_for_current would receive an array or vector instead of a scalar).

thanks,
Luiz.

Doesn't work on macOS Monterey.

Hi,

I've tried the library successfully on Linux but on my development machine running macOS Monterey (version 12.6.3) it doesn't work with version 0.8.0 or 0.8.1 of this crate.

The Vec of available cores returned by core_affinity::get_core_ids() does contain the core I'm trying to pin to but the boolreturned from core_affinity::set_for_current(core_id) is false.

Are there any tricks I need to apply on Mac?

Kind regards,
Nicholas

Allow setting core affinity for the whole process

On Windows, you can set the affinity for the whole process which is then inherited by child processes. Unfortunately, this is not the behavior for thread affinities.

Could it be possible to also add a set_for_current_process function ?

core_affinity::get_core_ids does not actually get a list of cores on linux

The documentation for

"core_affinity::get_core_ids"

says:
"This function tries to retrieve information on all the "cores" active on this system."

But what the function actually does is call sched_getaffinity, and check which cores the current thread is allowed to run on.

On a freshly started thread, this will typically be all cores on the machine.

However, if affinity has been set, the core_affinity::get_core_ids-function will return only the cores the current thread is allowed to run on.

I think the documentation, or the implementation should change.

(I was bitten by this. In my test-suite all but the first test that ran hade horrible performance. Turns out all but the first test actually ran with affinity = core 0 for all threads, since the first test had set the affinity for the main thread to core 0)

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.