Click here to Skip to main content
15,886,422 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionSide-by-side installation of .Net frameworks on Citrix Metaframe servers Pin
Dylan Morley8-Sep-11 22:40
Dylan Morley8-Sep-11 22:40 
AnswerRe: Side-by-side installation of .Net frameworks on Citrix Metaframe servers Pin
Matt U.9-Sep-11 8:01
Matt U.9-Sep-11 8:01 
AnswerRe: Side-by-side installation of .Net frameworks on Citrix Metaframe servers Pin
jschell10-Sep-11 7:53
jschell10-Sep-11 7:53 
GeneralRe: Side-by-side installation of .Net frameworks on Citrix Metaframe servers Pin
Dylan Morley11-Sep-11 21:46
Dylan Morley11-Sep-11 21:46 
QuestionCreate multiple instances of class for multi-threading Pin
HentoDeluxe8-Sep-11 11:40
HentoDeluxe8-Sep-11 11:40 
AnswerRe: Create multiple instances of class for multi-threading Pin
MicroVirus8-Sep-11 12:54
MicroVirus8-Sep-11 12:54 
GeneralRe: Create multiple instances of class for multi-threading Pin
HentoDeluxe9-Sep-11 5:17
HentoDeluxe9-Sep-11 5:17 
AnswerRe: Create multiple instances of class for multi-threading Pin
Luc Pattyn9-Sep-11 5:38
sitebuilderLuc Pattyn9-Sep-11 5:38 
Assuming each simulation takes a small amount of input data, and generates a significant amount of output data, this is what I would do:
- create a single queue with "jobs" (instances of a Job class), each job describing one simulation, with the associated input values;
- have N threads each executing the same code, basically a loop getting a job from the job queue (needs a lock while dequeueing, not while simulating); have each thread stuff its results in:
= the Job object itself, if that is reasonnable (depends on amount and kind of results);
= its own output container (a queue, a file, whatever);
= a shared resource, such as a database.
- launch these N threads where N would equal the number of processors available (i.e. Environment.ProcessorCount), or the number of processors you willing to spend to this work.
- if necessary, have some post-processing that collects all the results, sorts them in the order you want, etc.

The one thing you must watch out for, is results requiring locks for too long a period (in case you use a shared output container), causing other threads to stall.

BTW: if there are many jobs, there is no need to first stuff them all in a queue, you could as well have a separate process that continues to feed the job queue while your simulator threads are already processing some jobs.

Note: if the calculating threads have reasons to stall (e.g. they need file, network, or database data) then you should observe the processor load (with Task Manager) and basically raise N till the CPU is fully loaded. Adding more threads beyond that point isn't going to improve things, and may even work against you.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

Questioncall exe file in vb.net Pin
vishnumoorthy6-Sep-11 16:35
vishnumoorthy6-Sep-11 16:35 
AnswerRe: call exe file in vb.net Pin
Pradeep Shukla6-Sep-11 17:37
professionalPradeep Shukla6-Sep-11 17:37 
GeneralRe: call exe file in vb.net Pin
Pravin Patil, Mumbai6-Sep-11 20:20
Pravin Patil, Mumbai6-Sep-11 20:20 
GeneralRe: call exe file in vb.net Pin
Pradeep Shukla7-Sep-11 4:07
professionalPradeep Shukla7-Sep-11 4:07 
GeneralRe: call exe file in vb.net Pin
Pete O'Hanlon7-Sep-11 4:32
mvePete O'Hanlon7-Sep-11 4:32 
GeneralRe: call exe file in vb.net Pin
Pradeep Shukla7-Sep-11 4:37
professionalPradeep Shukla7-Sep-11 4:37 
GeneralRe: call exe file in vb.net Pin
Pete O'Hanlon7-Sep-11 4:55
mvePete O'Hanlon7-Sep-11 4:55 
GeneralRe: call exe file in vb.net Pin
PIEBALDconsult7-Sep-11 14:49
mvePIEBALDconsult7-Sep-11 14:49 
AnswerRe: call exe file in vb.net Pin
PIEBALDconsult7-Sep-11 3:02
mvePIEBALDconsult7-Sep-11 3:02 
AnswerRe: call exe file in vb.net Pin
Rakesh Meel10-Sep-11 0:31
professionalRakesh Meel10-Sep-11 0:31 
AnswerRe: call exe file in vb.net Pin
jkirkerx27-Sep-11 17:03
professionaljkirkerx27-Sep-11 17:03 
QuestionEnterprise Library caching problem Pin
maryam.saboor5-Sep-11 18:23
professionalmaryam.saboor5-Sep-11 18:23 
AnswerRe: Enterprise Library caching problem Pin
Mehdi Gholam6-Sep-11 17:30
Mehdi Gholam6-Sep-11 17:30 
AnswerRe: Enterprise Library caching problem Pin
Pradeep Shukla6-Sep-11 17:52
professionalPradeep Shukla6-Sep-11 17:52 
QuestionADO.NET Entity Framework and persistence encapsulation Pin
oraclepilot5-Sep-11 10:29
oraclepilot5-Sep-11 10:29 
QuestionForward Email by programattically using asp.net +C# Pin
Alok Kumar Sharma4-Sep-11 8:18
Alok Kumar Sharma4-Sep-11 8:18 
AnswerRe: Forward Email by programattically using asp.net +C# Pin
Wendelius4-Sep-11 10:13
mentorWendelius4-Sep-11 10: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.