摘要:
第一次种写法!,双检锁写法! public class SqlServerProxy:IDbContext { public static SqlServerProxy _SqlServerProxy=null; public static readonly object SqlServerProx 阅读全文
posted @ 2021-11-16 14:47
仲夏不凉爽
阅读(58)
评论(0)
推荐(0)
摘要:
何为单例模式!就是全局只new对象一次!然后把对象保存起来!如果下次要用!就不许要new了!节省多次new对象的的时间!而且也剩下很多内存! 但是!单例模式 //单线程写法,多线程有问题,多线程会new多次public class SqlServerProxy:IDbContext { public 阅读全文
posted @ 2021-11-16 14:29
仲夏不凉爽
阅读(411)
评论(0)
推荐(0)

浙公网安备 33010602011771号