Post
Topic
Board Development & Technical Discussion
Merits 16 from 3 users
Re: How to add multihreading to a continuous SECP256K1 Python function?
by
alexeyneu
on 06/11/2022, 17:47:08 UTC
⭐ Merited by NotATether (10) ,Welsh (4) ,ETFbitcoin (2)
best approach to python multithreading is to use c++ instead. that's from my secp tool
Code:
void brough(unsigned long long f);
int main()
{
    std::vector<unsigned long long> a{2, 4, 6, 8, 10, 12, 16};
    std::cout << std::endl;
    std::thread h[7];


    for(auto f : a)
    {
        h[f == 16 ? 6 : f/2 - 1] = std::thread(&brough, f);
    }
    h[0].join();
    h[1].join();
    h[2].join();
    h[3].join();
    h[4].join();
    h[5].join();
    h[6].join();

    return 0;
}

https://github.com/alexeyneu/secp256k1-cxx/blob/master/main.cpp#L33-L54