Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 30th, 2004, 12:06 PM
Authorized User
 
Join Date: Jun 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Apartment Threading and Reentrancy

MSDN says that reentrancy can occur in an apartment threaded dll when one of the the following occurs.
  • Invoking the properties or methods of an object on another thread, or in another process.
  • Raising an event thats handled by an object on another thread, or in another process.
  • Invoking a cross-thread or cross-process method from within a method.
If I call a method on an object I didn't write (therefore is black box), could that object perform one of the three above items and therefore cause reentrancy?
 
Old December 31st, 2004, 07:27 AM
Authorized User
 
Join Date: May 2004
Posts: 83
Thanks: 0
Thanked 1 Time in 1 Post
Default

DLLs are loaded in the same adress space as their client application so there is no question of reentrancy based on process space.

As far as the question of threading is concerned we can't write free-threaded apps in VB and hence can't call an object's methods on a thread other than the one on which we created the object.

So you should not worry about reentrancy until you are writing free threaded apps in VC++ and accessing the same object on multiple threads.

Further, it doesn't matter whether you wrote an ActiveX DLL or someone else did. What matters is reentrancy will occur if any of the three situations you mentioned occur.

Regards,
Ejan





Similar Threads
Thread Thread Starter Forum Replies Last Post
threading swifty_programmer ASP.NET 2.0 Basics 12 May 19th, 2007 06:10 AM
threading bschleusner C# 2005 2 April 12th, 2007 08:40 AM
multi threading [email protected] BOOK: ASP.NET Website Programming Problem-Design-Solution 1 February 26th, 2007 11:48 PM
Threading kramis8 C# 1 April 27th, 2005 04:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.