更新时间:2023-02-07 08:52:22
您可以使用事件,参数化的线程启动以及.NET提供的其他多线程技术
You can use events, parametrized thread-starts and other multi-threading techniues offered by .NET
一种方法是编写一个包装线程的类.该类将具有输入和输出字段的成员属性,并将公开足够的Thread
对象以启用同步和控制.线程main方法将是该类的成员,因此可以访问实例属性.
尼克
One way would be to write a class that wraps a thread. The class would have member properties for the input and output fields and would expose enough of theThread
object to enable synchronization and control. The thread main method would be a member of the class and so would have access to the instance properties.
Nick