cppfbp icon indicating copy to clipboard operation
cppfbp copied to clipboard

multi-thread support

Open dataf3l opened this issue 5 years ago • 5 comments

Does this program support multi-threaded programming?

dataf3l avatar Aug 15 '19 12:08 dataf3l

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?

dataf3l avatar Aug 15 '19 12:08 dataf3l

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!

jpaulm avatar Aug 16 '19 14:08 jpaulm

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

jpaulm avatar Aug 16 '19 14:08 jpaulm

Wait, isn't longjmp like, the devil????

On Fri, Aug 16, 2019 at 8:10 PM Paul Morrison [email protected] wrote:

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jpaulm/cppfbp/issues/7?email_source=notifications&email_token=AA25M4EZCOJ5R4GH3VB7CQ3QE235LA5CNFSM4IL5UBO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4OZO3Y#issuecomment-522033007, or mute the thread https://github.com/notifications/unsubscribe-auth/AA25M4HPDBWPGYUOIRCAPZLQE235LANCNFSM4IL5UBOQ .

dataf3l avatar Oct 12 '19 12:10 dataf3l

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!

jpaulm avatar Oct 12 '19 14:10 jpaulm