C#多线程。 [英] C# Multithreading.

查看:70
本文介绍了C#多线程。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我知道我正在使用的代码远非完美。我甚至不确定它是否完全符合预期,但我正在尝试执行以下操作:


我的资源类,从中加载几个表应用程序内的数据库。这是静态数据,不会发生变化,例如国家列表。这背后的基本思想是将所有查询运行到单独的线程中,以防止应用程序在加载数据时挂起。我正在使用以下代码:

Hello,

I''m aware that the code I''m currently using is far from perfect. I''m not even sure if it does exactly what it is supposed to do, but I''m trying to do the following:

My Resources class, loads several tables from the database inside the application. This is static data that doesn''t change such as a list of Countries for example. The basic idea behind this, is to run all the queries into seperate threads to prevent the application from hanging while the data is loading. I''m using the following code for that:

展开 | 选择 | Wrap | 行号

推荐答案

你有使用
You have to use
展开 | 选择 | Wrap | 行号



您好,


我知道我正在使用的代码远非完美。我甚至不确定它是否完全符合预期,但我正在尝试执行以下操作:


我的资源类,从中加载几个表应用程序内的数据库。这是静态数据,不会发生变化,例如国家列表。这背后的基本思想是将所有查询运行到单独的线程中,以防止应用程序在加载数据时挂起。我正在使用以下代码:

Hello,

I''m aware that the code I''m currently using is far from perfect. I''m not even sure if it does exactly what it is supposed to do, but I''m trying to do the following:

My Resources class, loads several tables from the database inside the application. This is static data that doesn''t change such as a list of Countries for example. The basic idea behind this, is to run all the queries into seperate threads to prevent the application from hanging while the data is loading. I''m using the following code for that:

展开 | 选择 | Wrap | 行号


这是我正在寻找的anwser :)

我将明确地给出代码,并在本主题中发布反馈,无论它是否顺利运行。
That was the anwser I was looking for :)
I will definitly give the code a go, and post feedback in this topic whether or not it runs smooth or not.


这篇关于C#多线程。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆