What is Runnable for?

I was thinking of creating thread one in my software, but I saw from the forums that Runnable helps in some way in creating a thread, and wanted to understand how it works.

Author: Piovezan, 2016-04-21

1 answers

I don't know anything about Runnable in C#, This is Java stuff. This class was required by a deficiency at the beginning of the language.

Even the use of raw thread is considered outdated in C#. Of course it can be used, but ideally, whenever possible, it is suitable, and almost always is, prefer to use Task, which will choose to create / use internal threads if necessary.

If you want to insist on this, take a look at ThreadStart.

 3
Author: Maniero, 2020-10-21 13:50:48