ASP does not support cross-session. Why does the application call the VB component?

Source: Internet
Author: User

 

IIS is a thread server, and every ASP is a thread. Therefore, the application must meet this requirement across sessions. Unfortunately, VB is a development tool for advanced applications and does not support cross-threaded components. It can only write single-threaded components. This is especially true for monkey vbs. Cross-thread is not allowed for objects defined by class in vbs.

To break through this point, you must use low-level development tools such as Vc and CB, and manually define interfaces, idispatch, iunknown, uid, and so on, even if vs.net 2005, in cb6.

The following is a reference of CB to illustrate the differences between various components.

Automation objects can have one of the following:

Single only one client thread can be serviced at a time. com serializes all incoming callto enforce this. Your code needs no thread support.
Apartment each object instantiated by a client is accessed by one thread at a time. you must protect against multiple threads accessing global memory, but objects can safely access their own instance data (object properties and members ).
Free each object instance may be called by multiple threads simultaneously. You must protect instance data as well as global memory.

Both this is the same as the free-threaded model, doesn t that all callbacks supplied by clients are guaranteed to execute in the same thread. this means you do not need protect values supplied as parameters to callback functions.
Neutral multiple clients can call the object on different threads at the same time, But Com ensures that no two CILS conflict. you must guard against thread conflicts involving global data and any instance data that is accessed by more than one method. this model shoshould not be used with objects that have a user interface. this model is only available under COM +. under COM, It is mapped to the apartment model.

 

Do not go into this issue too deeply, cProgramThe salary difference between employees and ASP programmers is obvious. When I want to use C to compile the required components, no one is willing to return to the cheap ASP project.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.