Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
The CPU is a microprocessor if it is integrated on a single chip, and there are no other things on that chip that would make it a full computer (in which case it would be a micro-controller).
And a breeding party of 9 cows (switch to animals for obvious reason..) still has a latency of 9 month to produce one calf. (They will of course produce 9, but that doesn't lower the 9 months). But they have a calving rate of 1 per month.
I am a C++ programmer, so I would use templates to make those functions sufficiently "known" at compile time to avoid indirection. But I must use some 'magic' to amke the tooling find the mains of all threads.
In my freferred C++ style I add: no indirections (no vurtuals, no function pointers). That makes it possible to calculate the stack size - one design nightmare less.
This seems to be a homework question. What have you done so far, where are you stuck? We can give you a nudge in the right direction, but we prefer not to give full homework answers, because we want the next generation of engineers to be capable.
Your second solution is used very common, and is often inside (smaller) driver chips. What is your power supply? Can't it absorb the current? The enegry has to go somewhere, either electrically or mechanically...