随笔分类 - C#Winform-多线程技术-线程同步和对其它线程资源的访问
摘要:原文链接地址: http://csharpindepth.com/Articles/General/Singleton.aspx#unsafe Implementing the Singleton Pattern in C# Table of contents (for linking purpos
阅读全文
摘要:第一种最简单,但没有考虑线程安全,在多线程时可能会出问题,不过俺从没看过出错的现象,表鄙视我…… public class Singleton{ private static Singleton _instance = null; private Singleton(){} public stati
阅读全文
摘要:这两天写设备的上位,由于要读取服务器上的数据库,通过WEBSERVICE访问数据库,我具体的做法是:1、专门用Timer起线程执行,由于在用的时候报错,不能访问其他线程资源的错误,因此我用了委托的方法解决,是从网上看的说是可以解决,代码如下: timer1 = new System.Time...
阅读全文