VB ActiveX DLL & Threading 
Author Message
 VB ActiveX DLL & Threading

A VB DLL is being called by ASP page. The DLL is

- how many instances of the component are created by IIS
- how is the above count decided (if above count > 1)
- how is the load distributed (if above count > 1)
- what is the destruction mechanism for objects

Does it makes the difference to the above if the DLL is put in COM+?

My DLL is in COM+ and is represented by a DLLHOST.exe in the taskmanager. At
some point, the dll gets struck and when i see the task manager - I see the
thread count increasing (usually by 2) on every call - but no calls returns.

I heard that VB DLL are created in STA (single threaded apartment). Does
this means that only one instance of the component is created and all calls
are queued (only one thread executes at a time - and if that thread is
struck, the whole queue is struck)?

How can I manage to set some timeout on every call in VB?

Thanks in advance.



Tue, 10 Aug 2004 06:55:37 GMT  
 VB ActiveX DLL & Threading
This is a very good topic for microsoft.public.platformsdk.complus_mts.
None of the groups you posted this to are particularly relevant.

Also, state the way your DLL is configured in COM+. My COM+
background is virtually non-existent, but the little I know seems
to indicate the answer will depend on the component's COM+
configuration.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

Quote:

> A VB DLL is being called by ASP page. The DLL is

> - how many instances of the component are created by IIS
> - how is the above count decided (if above count > 1)
> - how is the load distributed (if above count > 1)
> - what is the destruction mechanism for objects

> Does it makes the difference to the above if the DLL is put in COM+?

> My DLL is in COM+ and is represented by a DLLHOST.exe in the taskmanager. At
> some point, the dll gets struck and when i see the task manager - I see the
> thread count increasing (usually by 2) on every call - but no calls returns.

> I heard that VB DLL are created in STA (single threaded apartment). Does
> this means that only one instance of the component is created and all calls
> are queued (only one thread executes at a time - and if that thread is
> struck, the whole queue is struck)?

> How can I manage to set some timeout on every call in VB?

> Thanks in advance.



Tue, 10 Aug 2004 10:16:17 GMT  
 VB ActiveX DLL & Threading

Quote:

> A VB DLL is being called by ASP page. The DLL is

> - how many instances of the component are created by IIS

DamifIknow.

Quote:
> - how is the above count decided (if above count > 1)

The phase of the moon?

Quote:
> - how is the load distributed (if above count > 1)

Probably poorly.

Quote:
> - what is the destruction mechanism for objects

For objects created by IIS, it's usually by BSOD.

Quote:
> Does it makes the difference to the above if the DLL is put in COM+?

It'll slow things down by a little.  Maybe by a lot.

Quote:
> My DLL is in COM+ and is represented by a DLLHOST.exe in the taskmanager. At
> some point, the dll gets struck and when i see the task manager - I see the
> thread count increasing (usually by 2) on every call - but no calls returns.

> I heard that VB DLL are created in STA (single threaded apartment). Does
> this means that only one instance of the component is created and all calls
> are queued (only one thread executes at a time - and if that thread is
> struck, the whole queue is struck)?

What are the component's Threading Model and Unattended Execution
settings in &Project / Prop&erties / General?  What code creates
instances of your component's classes?  "Apartment Threaded" means
that instances created by different threads in the hosting EXE
should not block or otherwise interfere with one another.  Well,
unless they try to write to the same file or something like that...

Quote:
> How can I manage to set some timeout on every call in VB?

You shouldn't have to resort to this.

Anyway, if you want to update your component without having to shut
down and restart every five minutes, check this out:

 URL:http://groups.google.com/groups?selm=eLFRwPy7AHA.1284%40tkmsftngp04

--
Joe Foster <mailto:jlfoster%40znet.com>  Wanna buy a Bridge? <http://xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Tue, 10 Aug 2004 10:33:39 GMT  
 VB ActiveX DLL & Threading
Thanks Alex. I will post the mesg to that group.

About COM+ config:  i did the drag-drop to put the dll in COM+. The COM+ app
has a specific identity to run under - and all the rest is as default.
The dll is not queued and is being called from ASP.

The reason I posted the question here - is because of the question in the
beginning of my mesg. Those questions are not specific to COM+.
If you have any clue or links for me ... please forward.

Thanks again.


This is a very good topic for microsoft.public.platformsdk.complus_mts.
None of the groups you posted this to are particularly relevant.

Also, state the way your DLL is configured in COM+. My COM+
background is virtually non-existent, but the little I know seems
to indicate the answer will depend on the component's COM+
configuration.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> A VB DLL is being called by ASP page. The DLL is

> - how many instances of the component are created by IIS
> - how is the above count decided (if above count > 1)
> - how is the load distributed (if above count > 1)
> - what is the destruction mechanism for objects

> Does it makes the difference to the above if the DLL is put in COM+?

> My DLL is in COM+ and is represented by a DLLHOST.exe in the taskmanager.
At
> some point, the dll gets struck and when i see the task manager - I see
the
> thread count increasing (usually by 2) on every call - but no calls
returns.

> I heard that VB DLL are created in STA (single threaded apartment). Does
> this means that only one instance of the component is created and all
calls
> are queued (only one thread executes at a time - and if that thread is
> struck, the whole queue is struck)?

> How can I manage to set some timeout on every call in VB?

> Thanks in advance.



Sat, 14 Aug 2004 03:37:10 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. VB ActiveX DLL & Threading

2. ActiveX DLL, ActiveX EXE & ActiveX OCX version

3. ActiveX DLL, ActiveX EXE & ActiveX OCX version

4. MP3 ActiveX DLL With VB Amp v2 Player Example

5. ActiveX DLL & ActiveX EXE

6. Threading and Unattended Activex Dll

7. GURU/SEMI-GURU please help with ActiveX DLL threading question

8. ActiveX Dll: Should it be multi-threaded?

9. ActiveX DLL: Single and Apartment Threaded?

10. ActiveX DLL thread

11. What happened to the old Apartment threaded ActiveX dll

12. ActiveX DLL Threading model

 

 
Powered by phpBB® Forum Software