Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Apartment Model Thread
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00251823
Message ID:
00252515
Views:
8
Do you really need to know all of this to create COM Components? The great thing about coding COM Components in VFP and VB is the the fact that all of this is hidden from the developer and the developer can concentrate on writing the code that will eventually make the component do something.

>>>>>>Is that why a VFP MTDLL is not considered a true multi threaded com object?
>>>>>
>>>>>VFP uses apartment model threading because that is what MTS (and now COM+ in Win2000) requires. VB behaves the same way.
>>>>
>>>>True, but still as quoted directly from his white paper, "Apartment model threading provides a simulation of multi-threading, but does not really make an application truly multi-threaded and reentrant at the binary level as a C++ program."
>>>
>>>VFP can't generated free-threaded COM objects; neither can VB, and unless you're careful in coding it, not all C/C++ objects are, either. From a proactical perspective, unless you have asynchronous operations taking place with callbacks and spawning of multiple threads within the COM object, free-threading doesn't buy you a great deal.
>>
>>What are callbacks? What is spawning? In relation to my original question, if two stations are sharing the same thread, is it possible with some C/C++ objects to process their requests simultaneously, or would they both block each other.
>
>Callbacks are a hook back to the client that can be used to trigger an event in the client application or access a client's services when something happens at the server; the calling application provides an entrypoint that is called by the server. VFP doesn't have a callback mechanism either as a client or server.
>
>Spawning == creating.
>
>Yes, it's is possible for a single COM Object with multiple threads of execution to simultaneously service requests.
>
>It is possible for a VFP MTDLL to operate in a non-blocking fashion, but since there is really only a single thread of execution, if you need to have several identical instance of a method to execute simultaneously, ytou need to use MTS to manage multiple instances of the object. It is possible with the MTDLL for a VFP COM Server with multiple COM interfaces to accept and process calls to different methods simultaneously, but the payoff for this is low - in most cases, interspersing execution will result in a longer total time of execution for multiple simultaneous invocations vs a singel line of execution performing operations serially. The difference is that there may be a perception of faster service by the user if seeral requests are serviced at once, since while the total time of execution is longer, the time to complete any one call may appear shorter because of sequence of execution.
Tim Westmoreland
Software Engineer
Skyline Technologies, Inc.

"Upper classes are a nation's past; the middle class is its future." - Ayn Rand, Russian-born author (1905-1982).
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform