jpaulm/cppfbp

multi-thread support

Opened this issue · 5 comments

Does this program support multi-threaded programming?

I'm asking because doing "ack thread" yields some results, the word thread is mentioned a lot in the lua module, but it isn't mentioned on the other modules as much, only an include on the core file, so I think it is reasonable to assume without in-depth knowledge of the codebase, that the code does not support multiple threads in paralel executing tasks, that is, each node in the network isn't ran on a different thread, but instead, it looks like a single threaded program (this makes sense.

If you consider the program probably started before the moore law stopped being a thing (90s?? early 2000s?), and in general multi-core computers were not a thing yet), so should this program become paralel?

Should this program be altered to add multi-threaded capabilities, using a portable c or c++ library that supports threads like posix?

and, if I'm wrong and the program actually IS multi-core, where are the guts of the multi-core logic defined?

Good question! I use BOOST - https://www.boost.org/ - to provide multithreading. It allows every C++FBP process to run in its own thread... I did mention BOOST in the web page, but I guess I didn't say why I use it! I will try to fix that!

More info on BOOST has been added to https://github.com/jpaulm/fbp, and also to https://github.com/jpaulm/cppfbp/blob/master/README.md . Please let me know if it needs more info... TIA

Ah, I see! I wrote "an older C implementation called THREADN, which used longjmp and setjmp", which could, I guess, be confusing! The scheduling parts of CppFBP now use BOOST, which I did mention - it's the other parts of THREADN which have largely stayed the same. I will rephrase the Readme...

Thanks, Felipe!