1 Reply Latest reply on Dec 10, 2010 9:32 AM by tedk

    Running c++ apps on RCCE emulator

    KARTHIK

      Hi All,

       

      I am working towards running few PDES (Parallel Discrete Event Simulation) on RCCE emulator and have the following questions:

       

      1) The RCCE specification says that currently RCCE emulator is available for C programs only. But from the makefile I could see g++ is used for compilation. Hence I tried compiling a c++ program with symbol main replaced with RCCE_APP. The c++ app ran as expected. Is the reason for not using C++ apps is because C++ STL uses heap for creating objects and since heap is shared between all threads it leads to incorrect execution?

       

      I ask this because I actually face a similar situation. My RCCE_APP which is a PDES application in turn uses a PDES library and both are in c++. Inside a library function it creates a STL vector object and manipulates it. When one thread manipulates this vector object, the other thread gets this modified copy and the execution is incorrect due to this. I wanted a separate copy of this STL vector object, i.e I want them to be allocated on stack. But it seems STL vector objects are allocated on heap. Your comments are welcome.

       

      Thanks for your time,

      karthik