Click here to Skip to main content
15,889,335 members
Home / Discussions / C#
   

C#

 
GeneralRe: Threading Question Pin
LimitedAtonement11-Jun-10 8:23
LimitedAtonement11-Jun-10 8:23 
AnswerRe: Threading Question Pin
Luc Pattyn11-Jun-10 8:31
sitebuilderLuc Pattyn11-Jun-10 8:31 
GeneralRe: Threading Question Pin
LimitedAtonement11-Jun-10 8:48
LimitedAtonement11-Jun-10 8:48 
GeneralRe: Threading Question Pin
Luc Pattyn11-Jun-10 9:03
sitebuilderLuc Pattyn11-Jun-10 9:03 
GeneralRe: Threading Question Pin
harold aptroot11-Jun-10 9:29
harold aptroot11-Jun-10 9:29 
GeneralRe: Threading Question Pin
LimitedAtonement11-Jun-10 10:31
LimitedAtonement11-Jun-10 10:31 
GeneralRe: Threading Question Pin
Luc Pattyn11-Jun-10 11:23
sitebuilderLuc Pattyn11-Jun-10 11:23 
GeneralRe: Threading Question Pin
Daniel Grunwald11-Jun-10 13:58
Daniel Grunwald11-Jun-10 13:58 
Your explanations sounds like STA is a per-project setting. It's not. It's actually a per-thread setting, and the attribute on void Main just controls the setting for the main thread.

You can have both STA threads and MTA threads in the same application. And yes, you can have multiple STAs running concurrently.

COM objects living in a STA have all their calls executed on the thread associated with that STA (calls are marshaled to that thread and executed sequentially).
COM objects living in a MTA have their calls executed by any MTA thread, so there can be many calls running concurrently.

Of course, all this is revelant only for threads that create COM objects. Some Windows Forms controls require the GUI thread to be in a STA, but apart from that, threading apartement doesn't matter for a pure .NET application.
GeneralRe: Threading Question Pin
Luc Pattyn11-Jun-10 14:58
sitebuilderLuc Pattyn11-Jun-10 14:58 
AnswerRe: Threading Question Pin
LimitedAtonement15-Jun-10 2:49
LimitedAtonement15-Jun-10 2:49 
QuestionRe: Threading Question Pin
LimitedAtonement15-Jun-10 2:48
LimitedAtonement15-Jun-10 2:48 
QuestionProblem Here how can i deal [modified] Pin
Pellatrex11-Jun-10 2:14
Pellatrex11-Jun-10 2:14 
AnswerRe: Problem Here how can i deal Pin
Richard MacCutchan11-Jun-10 2:55
mveRichard MacCutchan11-Jun-10 2:55 
AnswerRe: Problem Here how can i deal Pin
R. Giskard Reventlov11-Jun-10 2:55
R. Giskard Reventlov11-Jun-10 2:55 
AnswerRe: Problem Here how can i deal Pin
Peace ON11-Jun-10 2:56
Peace ON11-Jun-10 2:56 
AnswerRe: Problem Here how can i deal Pin
Luc Pattyn11-Jun-10 3:00
sitebuilderLuc Pattyn11-Jun-10 3:00 
AnswerRe: Problem Here how can i deal Pin
harold aptroot11-Jun-10 3:00
harold aptroot11-Jun-10 3:00 
GeneralRe: Problem Here how can i deal Pin
Luc Pattyn11-Jun-10 3:47
sitebuilderLuc Pattyn11-Jun-10 3:47 
AnswerRe: Problem Here how can i deal Pin
riced11-Jun-10 4:29
riced11-Jun-10 4:29 
GeneralRe: Problem Here how can i deal Pin
Eddy Vluggen11-Jun-10 5:10
professionalEddy Vluggen11-Jun-10 5:10 
GeneralRe: Problem Here how can i deal Pin
Luc Pattyn11-Jun-10 5:25
sitebuilderLuc Pattyn11-Jun-10 5:25 
AnswerRe: Problem Here how can i deal Pin
i.j.russell12-Jun-10 0:03
i.j.russell12-Jun-10 0:03 
QuestionCombobox problem Pin
Hum Dum10-Jun-10 23:02
Hum Dum10-Jun-10 23:02 
AnswerRe: Combobox problem Pin
ddecoy11-Jun-10 1:15
ddecoy11-Jun-10 1:15 
GeneralRe: Combobox problem Pin
Hum Dum11-Jun-10 1:58
Hum Dum11-Jun-10 1:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.