[haiku-commits] Re: r41847 - in haiku/branches/developer/bonefish/signals: headers/private/kernel src/system/kernel/scheduler

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 31 May 2011 14:04:48 +0200

On 2011-05-31 at 09:30:21 [+0200], Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> 
wrote:
> ingo_weinhold@xxxxxx wrote:
> > Log:
> > Moved function context_switch(), which was duplicated in all scheduler
> > implementations, to scheduler.cpp and renamed it to
> > scheduler_switch_thread().
> 
> It would have been inlined before,

Only with gcc 4 as it wasn't marked inline.

> which might make a measurable 
> difference,

The overhead for the call is relatively small compared to what is done when 
switching the thread and even smaller with respect to the whole
*_reschedule() function. So, unless you measure the *_reschedule() itself, I 
seriously doubt that there is a measurable difference.

> ie. for things like the scheduler, code duplication might even 
> make sense.

Maintaining three exact copies of the same code doesn't make sense whichever 
way you look at it. If you're concerned about performance, we could move the 
function to a common header and declare it inline, though.

CU, Ingo

Other related posts: