- 0
- 0
- 约6.85千字
- 约 18页
- 2017-03-09 发布于上海
- 举报
Threading using Cand 线程使用C #和.Net Old Dominion University
* Calls to Exit are enclosed in finally blocks to ensure that they’re executed even when an exception arises. Otherwise it may lead a thread to acquire lock indefinitely and causes other threads to hang. * Finally block is there but can’t be seen. It is automatically generated in the CIL statements. * AcquireReaderLock blocks if the lock is currently owned by a writer thread but not if it’s owned by other reader threads. AcquireWriterLock blocks if the lock is owned by any one. Consequently multiple threads can read the resource concurrently , but only one thread at a time can write to it and it can’t wait if another thread is reading. * * * * * Threading using C# and .Net cs795 Satish Lakkoju Outline : Threads System.Threading Namespace . Thread Class – its methods and properties. Thread Synchronization. Monitors C# Lock keyword. Reader/Writer Locks Conclusion Threads : Thread is the fundamental unit of execution. More than one thread can be executing code inside the same process (application). On a single-processor machine, the operating system is switching rapidly between the threads, giving the appearance of simultaneous execution. With threads you can : Maintain a responsive user interface while background tasks are executing Distinguish tasks of varying priority Perform operations that consume a large amount of time without stopping the rest of the application System.Threading Namespace Provides classes and interfaces that enable multithreaded programming. Consists of classes for synchronizing thread activities . Chief among the namespace members is Thread class Thread Class Implements various methods properties that allows to manipulate concurrently running threads. Some of them are : CurrentThread IsAlive IsBackground Name Priority ThreadState Starting a thread : Thread thread = new Thread(new ThreadStart (ThreadFunc)); //Creates a thread object // ThreadStart identifies the method that the thread executes when it
您可能关注的文档
- The United States Government美国政府.ppt
- The Union for the Mediterranean is a proposed 地中海联盟是一个提议.ppt
- The United States interest in the Middle East teacher 美国感兴趣的中东教师.ppt
- The Unsupervised Learning of Natural Language Structure自然语言结构的无监督学习.ppt
- The Upper Extremity CCRI上肢中棉所.ppt
- The United States Presidential Election Process美国总统选举过程.ppt
- The Use of Dynamic Financial Analysis to Determine Whether an使用动态财务分析以确定是否.ppt
- The USA and Gun Control Eastwood High School美国和枪支管制伊斯特伍德高中.ppt
- The Upanishads Queen's University奥义书女王大学.ppt
- The use of machine translation tools for crosslingual text机器翻译工具在跨语言文本中的应用.ppt
- 广东省广州省实验中学教育集团2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 广东省广州大学附属中学2025-2026学年八年级上学期奥班期中物理试题(解析版).docx
- 广东省广州市第八十六中学2025-2026学年八年级上学期期中物理试题(含答案).docx
- 广东省广州市第八十九中学2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 广东省广州市第二中学2025-2026学年八年级上学期期中考试物理试题(含答案).docx
- 广东省广州市第八十六中学2025-2026学年八年级上学期期中物理试题(解析版).docx
- 广东省广州市第八十九中学2025-2026学年八年级上学期期中考试物理试题(含答案).docx
- 广东省广州市第二中学2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 2026《中国人寿上海分公司营销员培训体系优化研究》18000字.docx
- 《生物探究性实验教学》中小学教师资格模拟试题.docx
原创力文档

文档评论(0)