Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

NameYou

@NameYou
About
Posts
6
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Another Threading Question
    N NameYou

    In C#, how does one make a thread live indefinitely? MyObject obj = new MyObject(); Thread t = new Thread(new ThreadStart(obj.MyMethod)); t.Start(); Because MyMethod has code in it that kicks off an asynchronous process in it, I want that thread to live forever (or at least until the application is terminated). Any ideas on how that might be accomplished? Thank you, Dan

    C#, King of languages

    C# question csharp

  • Threading Question
    N NameYou

    OK, I understand that, but what I am getting at is that if I had the data write to a file at the end of the reading routine, that file write routine would be executed 4 times (since I have four threads) which is slower than dumping all of the read data into a buffer and then writing the buffer outside of the 4 threads - am I correct? Speed is of the essence with this procedure.

    C#, king of languages

    C# csharp question tutorial

  • Threading Question
    N NameYou

    I'm not sure I understand Asynchronous method calling? I've never seen that before. Could you point me in the direction of some information on that, or shoot me over some example code?

    uh... yeah

    C# csharp question tutorial

  • Threading Question
    N NameYou

    Ah I see what you are saying - my problem is this: then I have multiple disk IO reads, which will slow the system down compared to one. In this project, speed is absolutely necessary. Is there any way that I can write it to memory, so that I can combine the 4 results and write to the file once?

    C#... king of languages

    C# csharp question tutorial

  • Threading Question
    N NameYou

    Let me give you some psudeo code - because I'm not understanding. Here is what I am doing: public class MainClass { private void GetData() { MyObject mo = new MyObject(); Thread t = new Thread(new ThreadStart(mo.Connect)); t.Start(); MyObject mo2 = new MyObject(); Thread t2 = new Thread(new ThreadStart(mo2.Connect)); t2.Start(); MyObject mo2 = new MyObject(); Thread t3 = new Thread(new ThreadStart(mo3.Connect)); t3.Start(); MyObject mo3 = new MyObject(); Thread t4 = new Thread(new ThreadStart(mo4.Connect)); t4.Start(); //WHAT I WANT TO DO IS BE ABLE TO GRAB THE RESULTS FROM THE THREADS STARTED ABOVE //AND PUSH THEM INTO A FILE. I NEED ALL OF THE DATA FROM ALL FOUR THREADS COMBINED INTO ONE FILE } } Public class MyObject { public MyObject() { } public void Connect() { //Starts all the socket stuff.. } //...OTHER SOCKET RELATED FUNCTIONS GO HERE. } How do I get the data in the Connect function to the calling function in MainClass?

    uh... yeah

    C# csharp question tutorial

  • Threading Question
    N NameYou

    I am developing a windows form app in C# -.net 1.1 framework. The app creates 4 objects and executes a "Go" method in 4 threads - each thread goes off, grabs some data from a UDP socket, and processes it. What I need is to get the processed data from each of the 4 threads (objects) and combine them into one string. I can not figure out how to get the individual threads to return anything. I tried to create a string and pass it to each object's constructor as a reference, but that went nowhere. Does anyone have any ideas on how I can accomplish this? Dan Senior Developer Mitsubishi Power Systems

    Now where did I put that Char....

    C# csharp question tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups