dimanche 17 septembre 2023

passing multiple arguments to pthread (including vector arguments)

I currently have a problem related with the use of pthread.h (since I am still pretty new at it) so I am really hopeful I could get some help from this forum..let's suppose I want to pass this function to a thread that is created with pthread.h :

    void test (long int begin, long int end, vector<long int> x)
    {
                    /*do something*/
    }

do you know how to include this function into that thread along with all of its arguments? Or am I even able to pass this into pthread??

And am I able to pass multiple functions with multiple parameters at the same time into pthread? any help from you is very appreciated, thx

Aucun commentaire:

Enregistrer un commentaire