如何实现线程和处理并发请求

编程入门 行业动态 更新时间:2024-10-25 08:21:18
本文介绍了如何实现线程和处理并发请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个列表对象,例如DBBL,BAL,SBL,LBF,BBL,...........这个列表对象有项目列表。我同时想要商店列表项目,例如当DBBL开始执行时,同时执行SBL等等,我认为线程是最好的方法,但不了解如何实现它。任何人都帮助我。 注意: 我想开发短信服务向持卡人广播短信对于许多银行。当交易发生时,短信会自动发送给持卡人。因此,应用程序需要将所有时间连接到银行服务器,以便同时获取每个银行的交易信息。为此我为每个银行创建了线程方法,因此一些事务通知没有发送。我想改进我的代码,然后如何做到这一点。

I have a list object e.g. "DBBL,BAL,SBL,LBF,BBL,..........." and this list object has list of item. I want store list item concurrently e.g. when DBBL start execution, same time execute SBL and so on, I think threading is the best way but don’t understand how to implement it. Anyone help me. Note: I want to develop a sms service to broadcast sms to card holder for many bank. When transaction is occurred then sms send to card holder automatically.For this reason application need to connect all time to bank server for getting transaction information for every bank concurrently. For this purpose i create thread method for every bank, as a result some transaction notification are not send.I want to improve my code, then how to do that.

推荐答案

当你使用C#时,任务可能是更好的解决方案! 看看这些文章: 任务并行库:n中的1个 [ ^ ] When you are using C#, a task might be the better solution! Look at these articles: Task Parallel Library: 1 of n[^]

更多推荐

如何实现线程和处理并发请求

本文发布于:2023-11-06 09:48:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1563358.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:线程   如何实现

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!