Thread support

The Lowdown on Threads

Do you understand all you need to know about threads and the COM+ object model? This tip, excerpted from InformIT,

    Requires Free Membership to View

discusses the new threading models for COM+.

Threads are a sequence of execution steps within a component. Individual components can support one or more execution points operating simultaneously. Such components are known as multi-threaded components. Before Windows 2000, components could support either the single-threaded apartment (STA) model or the multi-threaded apartment (MTA) model. With the advent of Windows 2000 and COM+, components can now support the thread-neutral apartment (TNA). TNA components are essential to tapping the full feature set of COM+ because they eliminate many of the drawbacks of STA and MTA components.

STA components are confined to executing on just a single thread. This is problematic because it can result in deadlock situations in which a process holds the only available thread to a component, thus blocking other processes. MTA components solve the problem of a single thread by allowing multiple threads to operate within a given component. The problem with STA and MTA components, however, is that they suffer from restrictions on just which threads are allowed to run in the component. TNA components solve this problem by supporting any available thread at any time.

In all large applications, proper thread management is critical to scalability and performance. Regardless of the threading model in use, COM+ provides the underlying support to manage threads for your components. This means that STA, MTA, and TNA components all work with COM+; however, the choice of threading model can negatively affect other COM+ features.

The most significant consequence of using Visual Basic for COM+ development is that Visual Basic 6.0 doesn't support the thread-neutral apartment model. Visual Basic components support only the STA model. Microsoft has indicated that Visual Basic will support the TNA model under version 7.0.

To read more about COM+, click over to InformIT. You have to register, but registration is free.

This was first published in November 2000

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.