vb System.Threading.ThreadPool类(方法)实例源码

下面列出了vb System.Threading.ThreadPool 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:System.Threadin   
' 导入命名空间
Imports System.Threading

Public Module Example
    Public Sub Main()
        ' Queue the work for execution.
        ThreadPool.QueueUserWorkItem(AddressOf ThreadProc)
        
        Console.WriteLine("Main thread does some work, then sleeps.")

        Thread.Sleep(1000)

        Console.WriteLine("Main thread exits.")
    End Sub

    ' This thread procedure performs the task.
    Sub ThreadProc(stateInfo As Object)
        ' No state object was passed to QueueUserWorkItem, so stateInfo is null.
        Console.WriteLine("Hello from the thread pool.")
    End Sub
End Module


问题


面经


文章

微信
公众号

扫码关注公众号