CybeX
CybeX

Reputation: 2396

Multithread Console Application using separate consoles

I am creating a c# multithread console application, my solution uses +2 projects, 1 as a "main" project, then sub projects as the program's actual functions, however

running a sub project thread runs perfectly, however I would like this thread(s) to open a console of its own,

the only method I am familiar with is launching it separately but that would defeat the purpose of the threading

Upvotes: 1

Views: 1067

Answers (2)

CybeX
CybeX

Reputation: 2396

I have discovered the answer, this question has already been answered, but I will answer my own question in a more understandable way

Open a new console with every new Thread in C#?

Refering to the link above, a poster mentioned that each process can have only 1 console associated with it, thus 1 process -> 1 console

thus for each thread a new console has to be created and assigned to the thread, thus creating a new process with in the thread's code

Upvotes: 2

Philip W
Philip W

Reputation: 791

It's not possible for a process to own multiple consoles, so in order to work you need to start additional processes and send data to them (which is not trivial)

A better solution would be to create a winforms or wpf project and create multiple windows. It's much easier, and the way to go...

Upvotes: 1

Related Questions