Class class1
{
Public:
M_data1;
M_data2;
Memfunc ();
Virtual vfunc1 ();
Virtual vfunc2 ();
Virtual vfunc3 ();
};
Class1 object instance:
When there are too many threads, there are too many threads.
┃ Vptr ──> vtable
When there are too many threads, too many threads
┃ M_data1 ┃ (* vfunc1) () ──> class1: vfunc1 ()
When there are too many threads, too many threads
┃ M_data2 ┃ (* vfunc2) () ──> class1: vfunc2 ()
When there are too many threads, too many threads
── (* Vfunc3) () ──> class1: vfunc3 ()
When there are too many threads, there are too many threads.
Class class2: Public class1 {
Public:
M_data3;
Memfunc ();
Virtual vfunc2 ();
};
Class2 object instance:
When there are too many threads, there are too many threads.
┃ Vptr ──> vtable
When there are too many threads, too many threads
┃ M_data1 ┃ (* vfunc1) () ──> class1: vfunc1 ()
When there are too many threads, too many threads
┃ M_data2 ┃ (* vfunc2) () ──> class2: vfunc2 ()
When there are too many threads, too many threads
┃ M_data3 ┃ (* vfunc3) () ──> class1: vfunc3 ()
Please refer to the following link for more information: memfunc ();