Click here to Skip to main content
15,909,437 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to create Expander in WinForm? Pin
tantja4-Oct-07 11:47
tantja4-Oct-07 11:47 
QuestionRe: How to create Expander in WinForm? Pin
TJoe4-Oct-07 12:14
TJoe4-Oct-07 12:14 
AnswerRe: How to create Expander in WinForm? Pin
tantja4-Oct-07 12:16
tantja4-Oct-07 12:16 
QuestionActivation or License Pin
andyr20054-Oct-07 10:25
andyr20054-Oct-07 10:25 
AnswerRe: Activation or License Pin
Ilya Verbitskiy4-Oct-07 10:48
Ilya Verbitskiy4-Oct-07 10:48 
AnswerRe: Activation or License Pin
TJoe4-Oct-07 12:11
TJoe4-Oct-07 12:11 
QuestionDataGridView button problem Pin
udikantz4-Oct-07 9:20
udikantz4-Oct-07 9:20 
QuestionIssues with Mutlithreading and STA [modified] Pin
Aaron VanWieren4-Oct-07 8:53
Aaron VanWieren4-Oct-07 8:53 
I am currently working on an app that requires large volumes of processing. The long story short, it was determined that threads would be the best way to split it up and increase performance of the application. Heres the catch: I have to use STA as the com objects used are registered as STA objects. Fun!

I ran a quick test with one STA/thread and two STA/threads both running the same code and the results show that the single thread was actually faster than using two threads. I figure this is due to the nature of the message queue and sequential processing. So my question is this, is there any way to have an STA that can process simultaneously without a performance decrease? My code is fairly simple:

 <br />
       ParameterizedThreadStart workerThread = new ParameterizedThreadStart(EditFeatureClass);<br />
       Thread protoThread = new Thread(new ThreadStart(ItterateFeatureClass));         <br />
                    protoThread = new Thread(workerThread);<br />
                    protoThread.SetApartmentState(ApartmentState.STA);                    <br />
                    protoThread.Name = featureName;<br />
                    protoThread.Priority = ThreadPriority.Highest;<br />
                    protoThread.IsBackground = true;<br />
                    protoThread.Start((object)featureName);<br />
<br />
                }



Any suggestions and comments would be appreciated (And no, I am stuck with STA).

I have posted a copy of the unedited document I have been working on in regards to this if it helps. It should be the second link - Thread Performance Testing.[^]
-- modified at 18:25 Thursday 4th October, 2007

_____________________________________________________________________

Our developers never release
code. Rather, it tends to escape, pillaging the countryside all around.

The Enlightenment Project (paraphrased comment)

Visit Me at GISDevCafe

AnswerRe: Issues with Mutlithreading and STA Pin
led mike4-Oct-07 9:52
led mike4-Oct-07 9:52 
GeneralRe: Issues with Mutlithreading and STA Pin
Aaron VanWieren4-Oct-07 10:34
Aaron VanWieren4-Oct-07 10:34 
AnswerRe: Issues with Mutlithreading and STA Pin
Luc Pattyn4-Oct-07 11:57
sitebuilderLuc Pattyn4-Oct-07 11:57 
GeneralRe: Issues with Mutlithreading and STA Pin
Aaron VanWieren4-Oct-07 12:12
Aaron VanWieren4-Oct-07 12:12 
GeneralRe: Issues with Mutlithreading and STA Pin
Luc Pattyn4-Oct-07 12:39
sitebuilderLuc Pattyn4-Oct-07 12:39 
QuestionProblems with opening Child Window in MDI Pin
RichardAlbrecht4-Oct-07 8:23
RichardAlbrecht4-Oct-07 8:23 
AnswerRe: Problems with opening Child Window in MDI Pin
KaineDunno4-Oct-07 8:38
KaineDunno4-Oct-07 8:38 
GeneralRe: Problems with opening Child Window in MDI Pin
RichardAlbrecht4-Oct-07 9:12
RichardAlbrecht4-Oct-07 9:12 
GeneralRe: Problems with opening Child Window in MDI Pin
Pete O'Hanlon4-Oct-07 10:40
mvePete O'Hanlon4-Oct-07 10:40 
QuestionBeing more generic Pin
Ryno Burger4-Oct-07 8:18
Ryno Burger4-Oct-07 8:18 
AnswerRe: Being more generic Pin
MartyExodus4-Oct-07 8:42
MartyExodus4-Oct-07 8:42 
AnswerRe: Being more generic Pin
PIEBALDconsult4-Oct-07 9:09
mvePIEBALDconsult4-Oct-07 9:09 
AnswerRe: Being more generic Pin
PIEBALDconsult4-Oct-07 9:14
mvePIEBALDconsult4-Oct-07 9:14 
AnswerRe: Being more generic Pin
Pete O'Hanlon4-Oct-07 10:37
mvePete O'Hanlon4-Oct-07 10:37 
AnswerRe: Being more generic [modified] Pin
Nissim Salomon4-Oct-07 11:05
Nissim Salomon4-Oct-07 11:05 
QuestionPost blog using C# Pin
Phoen254-Oct-07 8:02
Phoen254-Oct-07 8:02 
AnswerRe: Post blog using C# Pin
Judah Gabriel Himango4-Oct-07 9:13
sponsorJudah Gabriel Himango4-Oct-07 9:13 

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.