Re: C++ inlining as a multithreading optimization tecnique?
From: Andre Kostur (nntpspam_at_kostur.net)
Date: 12/13/04
- Next message: Tom Widmer: "Re: save: reflection?"
- Previous message: Xenos: "Re: Can I refer to members of an enumeration without using ::?"
- In reply to: gianguz: "C++ inlining as a multithreading optimization tecnique?"
- Next in thread: GianGuz: "Re: C++ inlining as a multithreading optimization tecnique?"
- Reply: GianGuz: "Re: C++ inlining as a multithreading optimization tecnique?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: Tom Widmer: "Re: save: reflection?"
- Previous message: Xenos: "Re: Can I refer to members of an enumeration without using ::?"
- In reply to: gianguz: "C++ inlining as a multithreading optimization tecnique?"
- Next in thread: GianGuz: "Re: C++ inlining as a multithreading optimization tecnique?"
- Reply: GianGuz: "Re: C++ inlining as a multithreading optimization tecnique?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|