View email archives for the history of this mailing list.
systemc-forum - RE: [Systemc-forum] Quickthreads problems on Linux platform using Pthrea
- To: <systemc-forum@xxxxxxxxxxx>
- From: "Jyoti Swarup" <jyoti.swarup@xxxxxxxxxxxxxxxxx>
- Date: Thu, 5 Feb 2004 11:00:14 +0530
- Send Email to email@example.com:
- Send new message
- Reply to this message
Some more inputs to your problems.
We run the simulations in the main thread.
You might face problems if you run the simulations in other [ spawned]
The reason for this is that SC_THREADs are cooperative multitasking
called coroutines. The co-routines are generally implemented by
setjump and longjmp and stack-preserving techniques.
SystemC uses Qt on linux and Fibers on Windows [native]. To use these
You would first need to initialize it the thread you are going to
In windows, SystemC does it kernel/sc_cor_fiber.cpp with call with
Similar, initialization would be required linux there is a function
called stp_init In qt library,
but SystemC does not seem to be using it. [ ref:
Your problems could be fixed by either,
1) Running the simulations on the main thread. Or
2) Calling stp_init on the spawned threads [ I am not too sure]
Hope it helps..
From: Jyoti Swarup
Sent: Thursday, February 05, 2004 9:43 AM
To: Carey, Patrick; systemc-forum@xxxxxxxxxxx
Subject: RE: [Systemc-forum] Quickthreads problems on Linux platform
We have an implementation which we run simulation from one pthread, with
lots of SC_THREADS
And control and peek simulation from another threads. We do not face any
May be you have some memory corruption issue or not locking mutual
data-structure using mutexes.
From: Carey, Patrick [mailto:patrick.carey@xxxxxxxxx]
Sent: Wednesday, February 04, 2004 10:10 PM
Subject: [Systemc-forum] Quickthreads problems on Linux platform using
Has anyone had any success in getting SystemC threads (SC_THREADS) to
work on top of a system running Pthreads on Linux? I know from the past
few years that there was an issue with the Linux Pthread library in its
handling of certain pointers on the stack that causes errors with
malloc. We have a validation system where the base executable is
running Pthreads and this program kicks off other tools, one of which is
a SystemC design that has test threads in it. The test threads seg
fault with malloc due to the incompatibility described above. Does
anyone know if it is possible to reimplement the Pthreads library or any
other workaround so these two thread systems can coexist?