Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is single thread and multithread apartments model?

Answers were Sorted based on User's Feedback



what is single thread and multithread apartments model?..

Answer / gabriel

Single Thread model is the one that you run all the process
in only one thread, this thread is the "main" thread (and
the only one) and corresponds with the "main" of your
source code.

Multi-threading model, is the one that can run (let's say 4
process) two of them in the main thread and the other two
in other thread created by the main thread. Main thread can
creat as many threads as you want (with the right code of
course and the right cautions!) you need two more
conditions to have a REAL multithreading, is not enough for
you to code this, you also need a real multitasking
operative system, and a more than one processor.

Today with the DUAL CORE you could run one process in one
core and other in the other core, this is "almost" true,
because although you could code the right code, and you
have DUAL CORE, operative system (Win) will try to have
control over the execution threads, and ...althought you
code in C++ and you can use the AFFINITY property (which is
not in other languages) to set the affinity of a process to
a core... win always reserves the right to change the order
of execution....so? what happens?

Easy.... you have two or more threads, may be win decides
your process aren't important enough to respect your
affinity so, your threads will run in one core (is 'almost'
the same to have a single core processor, but not the same
because are lot of process running on the other core making
the core you get, less busy) so, actually will happen
this... the core that runs your threads will give to each
thread a "piece of time to run" so will "emulate a
multitasking" and sad but true, your multithreading looses
about 50% of importance to exist, but you still have other
advantages.

If you try a dumb code as writing a letter (eg "Z") on one
thread and (eg "Y) on the other, and you don't have a dual
core, or your affinity is not set, or even taken in
account, then you would see something like this

ZZZZZYYYYYYZZZZZZZYYYYZYZZZZZYYYYYYYZZZZZZYYY

Because the processor is iterating between threads and
given each a piece of time to execute.

Is This Answer Correct ?    2 Yes 1 No

what is single thread and multithread apartments model?..

Answer / guest

All components created with Visual Basic use the apartment
model, whether they?re single-threaded or multithreaded. A
single-threaded component has only one apartment, which
contains all the objects the component provides.

This means that a single-threaded DLL created with Visual
Basic is safe to use with a multithreaded client. However,
there?s a performance trade-off for this safety. Calls from
all client threads except one are marshaled, just as if
they were out-of-process calls.

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More Visual Basic Interview Questions

Types of LockEdits in RDO.

0 Answers  


What is the difference between adodc and adodb in vb?

0 Answers  


What is the difference Between ADO and other data access objects?

2 Answers   HCL,


How to set a shortcut key for label?

2 Answers  


Differentiate between DAO,ADO and Adodc as in data access objects?

0 Answers  


What is the use of Scalewidth and ScaleHeight Proeperty?

1 Answers  


How would you Create a Query Builder and Explain its uses ?

0 Answers  


How would you convert a form into document?

0 Answers  


Can We create CGI scripts in VB?

1 Answers  


Explain about Caturing Baseline.

0 Answers  


I'm getting error message "Reserved Error [-nnnn] ("There is no message for this error")" from Jet Engine 2.0.Why?

0 Answers  


What's the difference between MODAL and MODELESS forms?

0 Answers  


Categories