Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Multithreaded DLL in Singlethreaded TCL App

11 views
Skip to first unread message

suchit...@gmail.com

unread,
Jan 19, 2007, 4:47:31 AM1/19/07
to
Hi Everyone,

Scenario
-------------
I have a multithreaded DLL exposed through SWIG interface for TCL
application. The TCL application is a single threaded application by
default. The DLL launches multiple threads and tries to do some
processing.

Problem
------------
The application crashes with very little debug information available.

Question
-------------
Is it technically possible and correct to load a DLL that can launch
multiple threads through a TCL application that is essentially single
threaded?

Thank you in advance,
Suchit

Randolf Schultz

unread,
Jan 19, 2007, 8:04:34 AM1/19/07
to
suchit...@gmail.com wrote:
[...]

> Question
> -------------
> Is it technically possible and correct to load a DLL that can launch
> multiple threads through a TCL application that is essentially single
> threaded?

Yes, if you do not pass "CRT objects" across the DLL boundary.
See:
http://msdn2.microsoft.com/en-us/library/ms235460(VS.80).aspx

best regards,
Randolf,
--
http://www.ayam3d.org/ Ayam, parametric NURBS modelling.

Gerald W. Lester

unread,
Jan 19, 2007, 9:02:20 AM1/19/07
to

Yes with restrictions.

Some of which have been noted in other replies.

One big one is that you may only access the Tcl Interpreter and its data
structure from a single thread.


--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+

suchit...@gmail.com

unread,
Jan 20, 2007, 9:53:03 AM1/20/07
to
Randolf Schultz wrote:
> Yes, if you do not pass "CRT objects" across the DLL boundary.
> See:
> http://msdn2.microsoft.com/en-us/library/ms235460(VS.80).aspx

Thank you Randolf for your quick response. I have begun investigating
and will post updates soon.
Suchit

Message has been deleted

Alexandre Ferrieux

unread,
Jan 21, 2007, 1:14:55 PM1/21/07
to

Randolf Schultz wrote:
>
> > Is it technically possible and correct to load a DLL that can launch
> > multiple threads through a TCL application that is essentially single
> > threaded?
>
> Yes, if you do not pass "CRT objects" across the DLL boundary.
> See: http://msdn2.microsoft.com/en-us/library/ms235460(VS.80).aspx

Why not use a thread-safe version of Tcl, even though the app itself
doesn't create new threads ?
This way both ends of the DLL interface will use the same,
multithreaded, version of the C runtime...

-Alex

0 new messages