Click here to Skip to main content
16,004,927 members
Home / Discussions / C#
   

C#

 
GeneralRe: Rich text box Pin
StephenMcAllister3-May-05 19:14
StephenMcAllister3-May-05 19:14 
GeneralRe: Rich text box Pin
mav.northwind3-May-05 22:13
mav.northwind3-May-05 22:13 
Generalmake new folder in web site Pin
ABBASI_RA3-May-05 15:43
ABBASI_RA3-May-05 15:43 
GeneralRe: make new folder in web site Pin
Christian Graus3-May-05 16:12
protectorChristian Graus3-May-05 16:12 
GeneralTreeview Pin
StephenMcAllister3-May-05 15:01
StephenMcAllister3-May-05 15:01 
GeneralRe: Treeview Pin
Christian Graus3-May-05 15:08
protectorChristian Graus3-May-05 15:08 
GeneralRe: Treeview Pin
S. Senthil Kumar3-May-05 20:27
S. Senthil Kumar3-May-05 20:27 
GeneralParrallism in .NET Pin
Joshua Nussbaum3-May-05 14:47
Joshua Nussbaum3-May-05 14:47 
I came up with what I think Smile | :) is a good idea for making multithreading programming easier in any .NET language. .NET 2.0 adds the capability to write anonymous functions, it would be nice if there was a "parallel" statement, that could simplify writing threadprocs

<br />
public void DoSomeParallelStuff() {<br />
  parallel<br />
  {<br />
    {<br />
       // do some network stuff<br />
         // this is an anonymous ThreadProc<br />
    }<br />
    {<br />
     // do some IO stuff<br />
    }<br />
    {<br />
   // do some DB stuff<br />
  }<br />
 }<br />
<br />
  // do other stuff, on caller thread<br />
}<br />


behind the scenes the compiler could create the anonymous functions, add them to the ThreadPool by calling ThreadPool.QueueUserWorkItem. in some cases it would be nice to automatically block the caller thread, maybe a sister statement "parallel-blocked"

<br />
parrallel-blocked {<br />
 {<br />
  // read from drive c:<br />
  StreamReader rd = new StreamReader("C:\test.txt");<br />
  ...<br />
 }<br />
 {<br />
  // read from drive d: (done in parallel)<br />
  StreamReader rd = new StreamReader("D:\test.txt");<br />
  ...<br />
 }<br />
}<br />
<br />
// thread blocks until all parallel anonymous functions complete<br />
Console.WriteLine("Tasks complete");<br />


I think this would make it much easier to write multithread capable code. I've actually added this feature to a compiler I'm working on and it works quite nicely.

60% of statistics are made up on the spot
GeneralRe: Parrallism in .NET Pin
HopeDagger3-May-05 17:29
HopeDagger3-May-05 17:29 
GeneralArticles or sites on creating DLLs in C# Pin
Anonymous3-May-05 11:47
Anonymous3-May-05 11:47 
GeneralRe: Articles or sites on creating DLLs in C# Pin
MoustafaS3-May-05 12:05
MoustafaS3-May-05 12:05 
Generalvolume name of a CD Pin
novadProt3-May-05 11:45
novadProt3-May-05 11:45 
GeneralRe: volume name of a CD Pin
Dan_P3-May-05 18:44
Dan_P3-May-05 18:44 
GeneralRe: volume name of a CD Pin
novadProt4-May-05 7:33
novadProt4-May-05 7:33 
GeneralBorder around PictureBox Pin
Anonymous3-May-05 11:14
Anonymous3-May-05 11:14 
GeneralRe: Border around PictureBox Pin
MoustafaS3-May-05 12:17
MoustafaS3-May-05 12:17 
GeneralRe: Border around PictureBox Pin
Anonymous3-May-05 12:53
Anonymous3-May-05 12:53 
GeneralRe: Border around PictureBox Pin
MoustafaS3-May-05 13:00
MoustafaS3-May-05 13:00 
GeneralTraceSwitch Initialization Problem Pin
Peter Vertes3-May-05 11:12
Peter Vertes3-May-05 11:12 
GeneralStrongly naming referenced COM components Pin
RB@Emphasys3-May-05 10:18
RB@Emphasys3-May-05 10:18 
QuestionIs Label serializable? Pin
Anonymous3-May-05 9:37
Anonymous3-May-05 9:37 
AnswerRe: Is Label serializable? Pin
DavidNohejl3-May-05 11:01
DavidNohejl3-May-05 11:01 
AnswerRe: Is Label serializable? Pin
Marc Clifton3-May-05 15:34
mvaMarc Clifton3-May-05 15:34 
AnswerRe: Is Label serializable? Pin
Mathew Hall3-May-05 16:44
Mathew Hall3-May-05 16:44 
GeneralNeed help: Referencing Main Form from a Class Library. Pin
CarolAnnLove3-May-05 8:33
CarolAnnLove3-May-05 8:33 

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.