且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

逐个出队元素,然后将此值存储到MYSQL数据库

更新时间:2023-02-16 14:58:49

使队列出队< T>或ConcurrentQueue< T>并使用 ThreadPool.QueueUserWorkItem [
Dequeue your Queue<T> or ConcurrentQueue<T> and use ThreadPool.QueueUserWorkItem[^] to create threads that handles MySql INSERT statements.

But this can make a high load on MySql and connection creations. Perhaps it is better to do chunks of inserts ?