extensions icon indicating copy to clipboard operation
extensions copied to clipboard

Avoid buffer race conditions in CGroups

Open RussKie opened this issue 1 year ago • 3 comments

Fixes #5114

Microsoft Reviewers: Open in CodeFlow

RussKie avatar Apr 29 '24 06:04 RussKie

@RussKie can we use object pool instead of having it thread local? I'm a bit worried that if the methods are invoked each time from a different thread it will create a new buffer every time. Having an object pool instead will reuse the same buffer. The new buffer will be created only when there' no buffer in the pool which will rarely happen (only in case of contention).

mobratil avatar Apr 29 '24 08:04 mobratil

@mobratil what you think of this?

RussKie avatar May 17 '24 01:05 RussKie

@RussKie Now it looks good, thanks

mobratil avatar May 22 '24 08:05 mobratil