mercredi 1 novembre 2017

Behind the scenes of construction of a thread

It is known that how to use thread. But how is the thread library implemented. I mean, like we have std::string, its functionality can be somewhat replicated, by user himself using C-strings (char arrays), it is easy.

My question is how can i achieve this for the case of thread, like how can i create a class with bare-minimum C++ datatypes and functions(without WINAPI), std::thread like functionality into a class.

I would like to give a example, my teacher has prohibited me from using std::string, and allowed to only use C-strings, but i can use OOP concepts..

class string_my
{  
      private:
            char* str;
      public:
         // all the required func. to store the value in char*
 }

Aucun commentaire:

Enregistrer un commentaire