Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net 多线程Windows服务_.net_Vb.net_Multithreading_Visual Studio 2012_Event Log - Fatal编程技术网

.net 多线程Windows服务

.net 多线程Windows服务,.net,vb.net,multithreading,visual-studio-2012,event-log,.net,Vb.net,Multithreading,Visual Studio 2012,Event Log,如何以及在何处对代码进行多线程处理。我目前有一个从Windows系统日志收集事件的Windows服务。服务将收集的事件转发到远程服务。我的代码是用VB.NET编写的。我使用AddHandler和EventWrite来检测事件的生成时间。您可以使用TPL并为您想要的异步操作系统创建任务。然后使用Task.WaitAll完成任务。但是你几乎没有具体说明你真正的问题,这使得你很难给出建议。我怀疑您需要启动向服务发送事件的任务。等待变得困难,因为模型听起来已经是异步的 我想我已经清楚我真正的问题了。我有

如何以及在何处对代码进行多线程处理。我目前有一个从Windows系统日志收集事件的Windows服务。服务将收集的事件转发到远程服务。我的代码是用VB.NET编写的。我使用AddHandler和EventWrite来检测事件的生成时间。

您可以使用TPL并为您想要的异步操作系统创建任务。然后使用Task.WaitAll完成任务。但是你几乎没有具体说明你真正的问题,这使得你很难给出建议。我怀疑您需要启动向服务发送事件的任务。等待变得困难,因为模型听起来已经是异步的


我想我已经清楚我真正的问题了。我有一个用vb.net编写的Windows服务。它使用引用EventWrite的AddHandler方法的挂钩从Windows系统日志收集事件。本质上,每当系统生成新事件时,它都会收到通知。它目前是单线程的。我的问题是如何对这样的应用程序进行多线程处理?