Note that there are some explanatory texts on larger screens.

plurals
  1. USFreddie Chopin
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. COThe std::thread solution won't work for me - first of all the RTOS I'm using makes it impossible to use stdlibc++ from the toolchain (yes, I also agree it's stupid), second of all the C++11 design is probably a big overkill for my 24kB or RAM and 24MHz chip, third of all - this implementation is OS dependant and there's no real OS here (; As for your solution - using dynamic alocation this overhead could be temporary (all 3 pointers are not needed when the thread is started), but that would bring heap to the picture (; there's always a tradeof (;
      singulars
    2. CODon't get me wrong - I'm not saying you are mistaken, but I just never heard that calling static member functions is any different from calling normal C function (excluding name mangling, but that does not matter here), so I'm just curious - you never stop learning (; As a sidenote - the inheritance-method also uses static member function as a trampoline, so this is a "flaw" of both methods.
      singulars
    3. COabout _trampoline() not being extern "C" - why would that change anything, calling convention is known, I just don't really know what difference that would make... as for your last remark about the design being wrong it doesn't seem like a constructive comment - there's nothing wrong in saving a few bytes if you don't need to do anything special to achieve that and the solution with templates is as good as the one with inheritance... As for the middle thing (compositon vs. inheritance) you can easily create an object with one such Thread and inherit it - voila (;
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload