THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 19/12/2006 at 10:13, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.204
Platform: Windows ;
Language(s) : C++ ;
---------
We do several actions by threads. I learned, that initiating a gui-operation by a thread is dangerous - that might intercept cinema in the wrong moment and cause a desaster. We go through the whole project by a thread to test our model ( apply testcases on objects, materials, etc. ), that seems to be safe. We do a xml export with an own thread, seems to be safe. I have real big problems now in our import which works with an own thread to modify the model. We have a gui for it, and I buffered operations like write things to a log window by a thread safe fifo queue. But by system is still unstable.
Here what I have: Described in a simplified way, a GeDialog which has a log window, and an import thread running, adding stuff to the model like objects or materials or modifying existing ones. The import thread wants to write informations to the log, and from what I learnd, I implemented a thread safe fifo between the import thread and the log. The GeDialog has a timer, and whenever cinema now thinks it is the right time to do it, it takes a look on the fifo and checks for new log messages in order to display them. That mechanism normally works, for example in that thing which applies testcases to our model. But in case of the import, it has problems. I wrote a test, an import which writes a log entry, gets the active document and creates an object, and that 1000 times in a loop...all fine, works perfect. But I have other imports - of course the real ones to be delivered, not the test one - and they don't work fine. Everythign stops, and most of the times the call stack does not help me, sometimes I see the CDialogCallBack in c4d_gui.cpp.
Any hints what may go wrong? Ah yeah, and of course, to fullfill our delivery dates, the problem has to be solved until friday....besides other problems...nono, I don't panic yet...not yet, maybe tomorrow or so ;)