SergeyMakeev / TaskScheduler

Cross-platform, fiber-based, multi-threaded task scheduler designed for video games.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows CreateFiber performance

jerstam opened this issue · comments

I was curious about this comment in the code:

I don't use standard Windows Fibers since they are wasteful use of Virtual Memory space for the stack. ( 1Mb for each Fiber )

The CreateFiberEx function allows you to specify reserve & commit stack sizes. 1Mb seems to be only the default stack size if these are set to 0.

I'd love to hear your thoughts about this.

Try to compile and run this small test
https://gist.github.com/SergeyMakeev/65b8b3ee72c65b2a70534cd873e540f6

Here is my results (x64)

estimated : 78.125000 Mb
reality : 5007.000000 Mb

estimated : 16384 bytes
reality : 1050044 bytes

I have the same results, that's very strange... Anyways, thanks for this test.

commented

I have openned an issue with possible solution to ::CreateFiberEx stack size problem: #4