T
T
Tsiren Naimanov2015-05-25 17:19:29
C++ / C#
Tsiren Naimanov, 2015-05-25 17:19:29

Is it possible to create threads unmanaged?

new Thread(ShowAbout).Start();
in ShowAbout I have a method for opening the form "about"

About ab = new About();
            ab.ShowDialog();

Is it ok to use threads like this?
Or is it deplorable ...
I also use another thread to save parameters

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2015-05-25
@ImmortalCAT

Theoretically, since you create a form in the same thread in which you work with it, then everything is fine, another question is why do this and what do you achieve by this. In 98% of GUI applications, the entire interface is in one thread and everything works great (if a modal window or dialog opens, it just spins its own message loop), but just other threads are needed to perform lengthy calculations and I / O operations, so that the GUI thread does not stop and can easily continue to catch messages from the operating system for redrawing and user actions. So if this is not an experiment in a vacuum, then you need to think carefully why you need such feints - you need to manage several GUI streams very carefully.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question