Skip Nav
Home » Forums » SystemC Forum

Icon - KMLM List KMLM List

View email archives for the history of this mailing list.

List Home All Archives Dates Threads Authors Subjects
systemc-forum - RE: [Systemc-forum] Quickthreads problems on Linux platform using Pthrea Message Thread: Previous | Next
  • To: <systemc-forum@xxxxxxxxxxx>
  • From: "Jyoti Swarup" <jyoti.swarup@xxxxxxxxxxxxxxxxx>
  • Date: Thu, 5 Feb 2004 15:31:46 +0530
Send Email to systemc-forum@osci.kavi.com:
Send new message
Reply to this message
Hi,

We have SystemC simulations with SC_THREADs running pretty well on
spawned

threads in both pthread and winthreads environment. 

 

Regards,

~Jyoti

 

-----Original Message-----
From: Jyoti Swarup 
Sent: Thursday, February 05, 2004 11:00 AM
To: systemc-forum@xxxxxxxxxxx
Subject: RE: [Systemc-forum] Quickthreads problems on Linux platform
using Pthreads

 

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]
threads.

The reason for this is that SC_THREADs are cooperative multitasking
constructs 

called coroutines. The co-routines are generally implemented by
libraries, using 

setjump and longjmp and stack-preserving techniques. 

SystemC uses Qt on linux and Fibers on Windows [native]. To use these
libraries

You would first need to initialize it the thread you are going to
construct co-routines.

In windows, SystemC does it kernel/sc_cor_fiber.cpp with call with
ConvertThreadToFiber().

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:

http://www.cs.washington.edu/research/compiler/papers.d/quickthreads.htm
l ]

 

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..

 

Regards,

 

~Jyoti

 

-----Original Message-----
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
using Pthreads

 

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
problem.

May be you have some memory corruption issue or not locking mutual
data-structure using mutexes.

 

~Jyoti

 

-----Original Message-----
From: Carey, Patrick [mailto:patrick.carey@xxxxxxxxx] 
Sent: Wednesday, February 04, 2004 10:10 PM
To: systemc-forum@xxxxxxxxxxx
Subject: [Systemc-forum] Quickthreads problems on Linux platform using
Pthreads

 

 

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?

Thanks, 
Patrick Carey 


By Date: Previous | Next Current Thread By Thread: Previous | Next

  Mail converted by the most-excellent MHonArc 2.6.10