Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zltookkit Usage #225

Open
HalcyonHuang opened this issue Mar 29, 2024 · 0 comments
Open

zltookkit Usage #225

HalcyonHuang opened this issue Mar 29, 2024 · 0 comments

Comments

@HalcyonHuang
Copy link

HalcyonHuang commented Mar 29, 2024

I plan to use zltoolkit for development, the scenario is similar to: TcpClient receives > processes > tcp replies. Since the processing is time-consuming, if I use one thread for sending and receiving, and multiple threads for processing messages.

  1. Processing takes a certain amount of time, should network sending and receiving be separated from message processing in different threads? Since zltoolkit uses a thread pool, how to ensure that message processing and tcp sending and receiving are performed in different threads.

  2. If multiple threads are used for message processing, the processing time after receiving is uncertain. There are order requirements for sending and receiving, such as the receiving order is message 1 first, then message 2, then message 3, and the sending order requires sending message 1 first, then message 2, and then sending message 3. Will using a thread pool cause order problems?

打算使用zltookkit来做开发,场景类似: TcpClient接收 > 处理 > tcp回复 ,由于处理比较耗时,假如我用一个线程来做收发,多个线程来处理报文。

1.处理有一定的时间消耗,是不是应该把网络收发,和报文处理分开不同线程处理?由于zltoolkit用的线程池,怎么保证报文处理和tcp收发再不同线程进行.

2.假如用多个线程来进行报文处理,接收后的处理耗时不定 。 收发有顺序要求比如 接收顺序为 先报文1 然后报文2 然后报文3 ,发送顺序要求 先发送报文1 ,然后报文2,再发送报文3。使用线程池会不会导致顺序问题?

TRANS_BY_GITHUB_AI_ASSISTANT

@alexliyu7352 alexliyu7352 changed the title zltookkit使用 zltookkit Usage Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants