Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getcpu systemcall not implemented correctly #5239

Closed
Chronial opened this issue May 20, 2020 · 2 comments
Closed

getcpu systemcall not implemented correctly #5239

Chronial opened this issue May 20, 2020 · 2 comments

Comments

@Chronial
Copy link

Windows build number: 10.0.18363.778

The getcpu systemcall always reports that the process is running on core 0.

Minimal Example:

#include <iostream>
#include <sys/syscall.h>
#include <thread>

int main(){
    for(int i=0; i < 100; i++){
        std::thread([]{
            std::cout << sched_getcpu();
        }).detach();
    }
    return 0;
}

Running g++ main.cpp -lpthread && ./a.out always prints a row of 0. On a Linux it prints numbers between 0 and the number of cores of the cpu.

This is probably the cause of #3294

@therealkenc
Copy link
Collaborator

That's a great analysis and repro. Yes almost certainly cause of #3294. Better on WSL2.

image

@Chronial
Copy link
Author

Chronial commented Sep 5, 2020

Are WSL bugs not beeing fixed any more? Is there an official announcement about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants