vendredi 10 avril 2015

c# How to create a List of Threads?


Vote count:

-4




I'm trying to dynamically create Threads at run-time. I want to create threads when they are needed, perform a task then die. I have a simple client script in Unity that sends data to my server application. This is what I have got so far, but it does not work. What am I doing wrong? EDIT: "NOM NOM..." gets printed, but "Thread running" does not.



void listen() {
dataLength = serverSocket.ReceiveFrom(data, ref remote);
f.debug("NOM, NOM, NOM... DATA!");
threadList.Add(new Thread(processData));
threadList[threadList.Count - 1].Start();
}

void processData() {
f.debug("Thread running!");
}





asked 4 mins ago







c# How to create a List of Threads?

Aucun commentaire:

Enregistrer un commentaire