Results 1 to 4 of 4

Thread: Information on Single Threaded Apartments

  1. #1
    Join Date
    May 2009
    Posts
    54

    Information on Single Threaded Apartments

    I am learning vb for last some months. I came through multiple properties of it. Like recently I was developing a user control in vb. I tried to add a control to the project. But it was inactive. It was only going to get active if the threading mode is set to single. I want to know more about single threaded apartments. How it works, it's process and the structure.

  2. #2
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Information on Single Threaded Apartments

    The single threaded apartment offers a message based prototype. It mainly work to deal with many running objects. You can write a more reliable code by this. Evey thread in the action is assigned as a apartment model process. While the retrieves and dispatches windows messages is a single one. Every stays in his own apartment. As the logical group of similar objects that executes the same thread and should have a synchronous execution could stay on the same apartment. As both the interprocess and interthread models are same.

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Information on Single Threaded Apartments

    There are some rules you will need to follow in the single threaded apartments. They are simple but it is important to follow them to get an actual result. The first is that Only one thread must be assign to only single object. You will need to initialize the com library of every thread. While passing the objects between apartments you will need to marshal all pointers. At the time of a single process each single thread apartment must have an message loop to handle calls from other processes and apt.

  4. #4
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Information on Single Threaded Apartments

    Well for your query all the objects in a single thread will be assigned with the processes in the main thread. The sub main will be called for one time only and there only one set of global variables. The objects is linked with the thread that created it. The sub main is only called at one time for each particular thread.

Similar Threads

  1. Replies: 5
    Last Post: 08-04-2011, 10:36 AM
  2. Visual Studio 2008 multi-Threaded DLL
    By Panchu in forum Windows Software
    Replies: 6
    Last Post: 25-09-2010, 10:00 AM
  3. Single pcb gtx 295 sli with 2 pcb gtx 295
    By WajeehT in forum Monitor & Video Cards
    Replies: 5
    Last Post: 19-04-2010, 05:30 PM
  4. Multi-threaded Java Server
    By Paul in forum Guides & Tutorials
    Replies: 5
    Last Post: 02-03-2010, 05:40 PM
  5. Multi-threaded application uses only one core
    By KACY5 in forum Software Development
    Replies: 4
    Last Post: 10-11-2009, 07:10 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,710,818,877.93177 seconds with 16 queries