C#控制台程序如何处理多个请求(在同一时刻收到)? [英] How can a C# console program handle multiple requests (receives at the same moment)?

查看:168
本文介绍了C#控制台程序如何处理多个请求(在同一时刻收到)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我编写了一个c#控制台应用程序,它可以接收控制台参数,而不是根据从命令行接收的参数执行一些代码,它也有一个基本的队列结构。此队列结构处理当前执行
继续时收到的请求。但是,当多个请求同时出现并且只执行其中一个请求时,我的程序会失败。


exe有没有办法在同一时刻处理多个执行请求?在我的例子中,一个触发器应用程序运行命令(例如:Myapp.exe参数[i]参数[j])并将参数发送到我的程序中。例如,如果触发器应用程序同时找到3个匹配的
条件,则它运行"Myapp.exe s1 message","Myapp.exe s2 message"和"Myapp.exe s2 message"。和"Myapp.exe s3消息"和"Myapp.exe s3消息"。命令在同一时刻。并且Myapp.exe无法处理此命令。


祝你好运


Ugur




解决方案

您好,


您将有更好的机会找人通过显示到目前为止编码的代码以及发布代码时使用代码块按钮来帮助您。



Hello,

I wrote a c# console app that can receive console arguments than executes some code based on the received arguments from command line also it has a basic queue structure. This queue structure handles requests which are received when the current execution continues. However, my program fails when more than one requests comes at the same time and only one of them is executed.

Is there any way that an exe can handle multiple execution requests at the same moment? In my case, one trigger app runs a command ( ex: Myapp.exe argument[i] argument[j]) and sends arguments into my program. For example, if the trigger app founds 3 matching conditions at the same time, it runs "Myapp.exe s1 message", "Myapp.exe s2 message" and "Myapp.exe s3 message" commands at the same moment. And Myapp.exe can't handle this commands.

Best regards

Ugur


解决方案

Hello,

You will have a better chance at someone helping you by showing code that has been coded so far and when posting code use the code block button.


这篇关于C#控制台程序如何处理多个请求(在同一时刻收到)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆