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

ActiveX exe With thread pool - CreateObject fails

4 views
Skip to first unread message

Ophir

unread,
Feb 8, 2005, 9:56:32 AM2/8/05
to
Hello

I have an ActiveX exe that I first created with the option of Thread
per object and it worked fine. However I was limited in this method
with the number of overall threads I could open, so I modified it to
work with thread pool and made some changes to it to work that way.

Now if I specify a thread pool bigger then 2, at some point when
calling CreateObject the app hangs and CreateObject never return.
No errors no nothing simply the app is stuck and thats it.

The CreateObject is called from within one of the objects the EXE
expose.

If I use a thread pool of 1 or 2 I can get as many objects as I want.

Does anyone have an idea why this happens?

Thanks
Ophir.

Ophir

unread,
Feb 9, 2005, 8:16:40 AM2/9/05
to
OK I have an update.
Since I thought that there maybe a problem with my code I created
another ActiveX exe that expose 2 objects - One is an empty object with
no properties or data and a Worker object that has 3 routines:
1.DoWork(byval lngAmount as long) - which creates lngAmount of empty
object using CreateObject which will create them on threads using the
round-robin alg (as Microsoft describes in the msdn).

2.DoWork2(byval lngAmount as long) which will create the empty
objects on a single thread using the new operator.

3.ClearAll - which destroy the created objects.

If I give a Thread pool larger then 1, the first method of creation get
stuck after a while - CreateObject does not return. I have to kill the
ActiveX process and then get Automation Error.

The second method that uses only one thread always succeeds.

Since the empty class does nothing and has no code in it I believe this
is COM issue (bug)

Anyone encountered the same problem?

I use VB6 with SP6.
The problem occures on a WIN2K and WINXP machines.

0 new messages