News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Found a lock-free allocator, will this help?

Started by rickg22, May 09, 2011, 10:19:46 PM

Previous topic - Next topic

rickg22

Hi guys, I was researching on multithreading, and I found this little gem: Streamflow. It's a lock-free allocator for multithreaded apps. It means that you can allocate and deallocate as many objects as you can and it won't block the main thread for allocating memory.

http://people.cs.vt.edu/~scschnei/streamflow/

I was wondering if this could speed up some part of Codeblocks (code completion, perhaps? Search plugins?). What do you think?

ollydbg

The current allocator implementation in Codeblocks' SDK is not thread safe, see:
Re: using memory pool for the SearchTree Node
So, we have only One parserthread thread running at a time.

This "streamflow" can safely allocate memories from multiply thread?
I can see it's code, but have no idea how to use it, and does it multi platform support?

thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

MortenMacFly

I think the answer is quite simple: As this is a Linux-only project, there is no way we can make use of it. (It uses Linux headers all over the place... :shock:)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Ceniza

What about Intel Threading Building Blocks? It includes a memory allocator as well, and I think the license would allow us to use it in Code::Blocks.

Of course the real benefit comes from proper multithreading, for which we could also use the same library (both containers and algorithms).