Hey there ,
I am using embedded clips 6.4 on arm and need to let clips know that time has passed so that at some point the following rule can be executed. ( I believe there is no other way than to assert the (tick) fact every SECOND to make sure clips checks it during the next run ).
here is my while true loop which replaces the original commandloop function and keeps the engine up and ready. (while other parts assertstring in to the engine.)
So the thing is, every now and then , and mostly (not always) in case of an Assertstring of another fact (from elsewhere- not the loop but some background process which sends messages) , I get segmentation fault and kaboom ! like at the 200th tick.
Any thoughts on how to approach the whole thing, please ?
I would really appreciate the response and again THANK YOU MR.RILEY for this incredible design of yours
~~~
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, if you intend to share an environment across multiple threads, you shall protect it from mutual access of its API.
From the 1.2 Threads and Concurrency chapter of the Advanced Programming Guidelines:
Each environment can have at most one thread of execution. The CLIPS internal data structures
can become corrupted if two CLIPS API calls are executing at the same time for a single
environment. For example, you can’t have one thread executing rules and another thread
asserting facts for the same environment without some synchronization between the two threads.
Hey there ,
I am using embedded clips 6.4 on arm and need to let clips know that time has passed so that at some point the following rule can be executed. ( I believe there is no other way than to assert the (tick) fact every SECOND to make sure clips checks it during the next run ).
here is my while true loop which replaces the original commandloop function and keeps the engine up and ready. (while other parts assertstring in to the engine.)
So the thing is, every now and then , and mostly (not always) in case of an Assertstring of another fact (from elsewhere- not the loop but some background process which sends messages) , I get segmentation fault and kaboom ! like at the 200th tick.
Any thoughts on how to approach the whole thing, please ?
I would really appreciate the response and again THANK YOU MR.RILEY for this incredible design of yours
~~~
That "clock =" is meant to be " tick". My bad
Are you asserting facts concurrently from different threads? CLIPS does not
support multithreading on single environments.
Il giorno lun 13 set 2021 alle ore 07:11 Faraz Zabihian farazex@users.sourceforge.net ha scritto:
so, I need to thread lock the thing , I assume ?
thanks for your reply
Yes, if you intend to share an environment across multiple threads, you shall protect it from mutual access of its API.
From the 1.2 Threads and Concurrency chapter of the Advanced Programming Guidelines:
http://clipsrules.sourceforge.net/documentation/v640/apg.pdf
Oh , thanks for your reply
Oh , thanks for your reply
Oh , thanks for your reply
Oh , thanks for your reply