Parallel threading in iLogic

Parallel threading in iLogic

Anonymous
Not applicable
1,160 Views
4 Replies
Message 1 of 5

Parallel threading in iLogic

Anonymous
Not applicable

Hi

 

We have been experimenting with Parallel threading. The situation is that I have an assembly that contains multiple parts (approx. 40) which all have contained "almost" the same code. In order to rationalize this; we have rearranged the code in such way that we now only reference External iLogic rules form these 40 part files (only one place to revise the code if necessary).

 

The side effect to this rationalization has been tha we have problems in executing the codes in parallel, see this simplified example:

 

Imports System.Threading.Tasks

Parallel.For(1,40, Sub(h As Integer)
                    iLogicVb.RunRule ("Part "& h &"", "iTriggerRule")
                End Sub)

 

 Now all of these 40 part files try to execute their code.

 

 

'Configutation of Part files
iTrigger=iTrigger0
iLogicVb.RunExternalRule("Cut configuration")
iLogicVb.RunExternalRule("Bracing of the part")
iLogicVb.RunExternalRule("Parameter context")

 As they all are dependent upon running the same external rules the result is that not all part files are updated according to the required design requirements. It seem as if one of the part files calls the external rule and the rule is "busy" handling another part file it just terminates without warnings or errors.

 

Can multiple part files run the same external rule at the same time?

Is there some form of queue?

I do not get any warnings or errors, the partfiles just do not update. How can I make sure that all the part files run the external rules and is there a way of checking this?

 

Regards

Kari

 

Accepted solutions (2)
1,161 Views
4 Replies
Replies (4)
Message 2 of 5

philippe.leefsma
Alumni
Alumni
Accepted solution

Hi Kari,

 

iLogic is based on the Inventor API, which doesn't support multithreading and parralel tasks, so there is no chance iLogic can take advantage of parallel programming for the moment.

 

Being a COM API, the calls to the Inventor API are just getting queued in the order they are performed and then being executed sequentially, however with the iLogic extra layer and the potentially complex inter-dependencies between the rules, it is possible to have side effects like the one you mentionned.

 

My advice would be just not make use of parralel programming when using Inventor API or iLogic as you will hardly get any benefit out of it anyway.

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 5

jdkriek
Advisor
Advisor

Thank you Philippe, this is good information to know.

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


0 Likes
Message 4 of 5

Anonymous
Not applicable
Accepted solution

Thanks for the information.

 

I will follow your advice.

0 Likes
Message 5 of 5

maxim.teleguz
Advocate
Advocate

With later versions of inventor is this possible yet?

0 Likes