开发者

C# WinForm Concurrency with Invoke

I have a UI that 开发者_运维知识库occasionally interacts with a MSSQL DB. There is a heartbeat thread that inserts/updates data to the same DB within an Invoke statement.

1) Is my implementation a safeguard against DB data inconsistency/corruption?

2) Is Invoke the most efficient/simplest way of creating DB serialization between UI thread/heartbeat thread or are locks the way to go?


You should think about BackgroundWorker. It is good abstraction of calling Invoke method, It handle most of cases.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜