V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  hifeng  ›  全部回复第 1 页 / 共 1 页
回复总数  2
2025 年 6 月 12 日
回复了 hulalahei 创建的主题 C# 200 块有偿求助 C#高速读取串口,导致软件闪退的问题。
类里面建个队列,ConcurrentQueue<byte[]> datas =new ConcurrentQueue<byte[]>(2000)
回调直接读 BytesToRead 到 buff,
添加到队列 datas.Enqueue(buff) 就返回;
另外一个线程去处理 datas;
用了一个 e61919b01ca578a9 ,谢谢.
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   857 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 21:58 · PVG 05:58 · LAX 14:58 · JFK 17:58
♥ Do have faith in what you're doing.