Several Cogs that use the same cog
grasshopper
Posts: 438
I am running some 5 cogs that all require the Float32 cog. I want to run all 5 cogs, but not running the Float32 cog 5 times also. How can I implement Float32 in each of my 5 cogs without exceeding my cog limit?
Is this possible?
Thanks.
Is this possible?
Thanks.
Comments
The details of how you would do this depend on how your program is structured and how the cogs interact.
1. Create 5 Float32[noparse][[/noparse]x] objects (refer to Eight Talking Cogs in OBEX)
2. Use Semaphores as Mike Green suggested in his post above (refer to Eight Talking Cogs)
3. Save Float32 under five different filenames and use COGNEW/COGSTOP to run each different Float32x object in a cog one or two at a time (depending on the number of spare cogs available)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dennis B. Page, Page Radio Company
Mike listed some real complex things that I just cant understand at the moment.
Whether that would make any practical difference in how well your application works depends
on what you're trying to do.
It is one more alternative..
Revrite float32 to have 5 banks registers one bank for one procesand 5 same banks in HUB.
Programet write to HUB Vars that hold VARs to calkulate and write in HUB Flag register Flag for float32 to get it to calculate
Then have 5 HUB VARs in You program with results from float32 with one flag register on Result complete
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dennis B. Page, Page Radio Company
Reread My Post.
I sugest to revrite Float32 to serve 5 proceses in one COG using fuly Multiproces techniqe.
Not to have 5 COGs of same Float32.
Ps. Sorry·but I will say "" You have one FERRARI but RUN it how it was old T-FORD""
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
Post Edited (Sapieha) : 9/24/2008 2:18:28 PM GMT
That is another possibility; however, the one cog running 5 Float32 multiprocesses will advance one of the 5 Float32 multiprocesses per hub cycle whereas five cogs of the same Float32 object array will advance 5 Float32 processes per hub cycle. Thus, faster processing is achieved without the burden of writing a custom multiprocess for Float32.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dennis B. Page, Page Radio Company
Post Edited (Dennis B. Page, Page Radio Company) : 9/24/2008 5:34:53 PM GMT