Re: C++ inlining as a multithreading optimization tecnique?

From: Andre Kostur (nntpspam_at_kostur.net)
Date: 12/13/04


Date: Mon, 13 Dec 2004 16:55:49 GMT


"gianguz" <gianguglielmo.calvi@noze.it> wrote in
news:1102932384.776691.200510@c13g2000cwb.googlegroups.com:

> The question is about the possible use of inlining to improve
> performance in a heavy multithreading environment (200+ threads).
> If we have to work with applications in which threads aren't I/O
> bounded or user-time bounded (i.e. windows based applications) but
> they are concurrently involved in the execution of the same
> parallelized task (i.e. a matrix-matrix multiplication), we must ensure
> that the advantage obtained by the parallelization is not lesser than
> the overhead introduced by the context switching needed to suspend/wake
> up/run threads.
> My opinion is that we could use inline as a mechanism to improve contex
> switching performance.
> An inlined function doesn't need to save into the stack its calling
> with its own parameter. It is simply expanded into the code with a
> temporary copy of any parameter it carries. Restoring a thread
> execution in a point when an inlined
> function was called simply means restoring the program counter at that
> code line instead of popping from the stack the current function called
> with its own parameter. It seems to me a great save of memory space and
> time.
> Anyone has comments about that or has already experience such solution
> with some result?

The only answer that we can give is profile, profile, profile. _You_ need
to measure both mechanisms to determine which will be faster. Inlining may
remove the function call overhead, but may cause the size of your functions
to balloon to such a point that what you saved in function calls, you're
now paying in additional page swaps, or cache misses, or whatever.



Relevant Pages

  • C++ inlining as a multithreading optimization tecnique?
    ... If we have to work with applications in which threads aren't I/O ... My opinion is that we could use inline as a mechanism to improve contex ... An inlined function doesn't need to save into the stack its calling ... Restoring a thread ...
    (comp.lang.cpp)
  • Re: XP Roaming Profile Issue
    ... This behavior is because the applications are installed either by another ... The profile ships up and down to the ... > For example if they sit at a newly imaged machine and installs all their ... > with the user and is poulated with the respective application settings. ...
    (microsoft.public.win2000.active_directory)
  • Re: Pull report with or without relationships
    ... >My customer wants the report to show the Employee Profile with applications ... >if applications exisit OR the Profile alone. ... default join for any new query you create using these two ...
    (microsoft.public.access.formscoding)
  • Re: Start up in XP Pro
    ... For user logon applications are managed by the profile ... profile under documents and settings. ... > depending on what config you wanted. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Typed defun ?
    ... For both CMUCL and SBCL declaring the function as inline should remove the ... * Profile, profile, profile! ...
    (comp.lang.lisp)