Display: Cloud | List
Most Popular Tags
Results (41 total) All > threading (x)
Can be a lightweight replacement for critical sections (Slim Reader/Writer (SRW) Locks (Windows))
Using an SRW in exclusive mode can be a lightweight replacement for CRITICAL_SECTION. However, they don't offer as many debugging features as CRITICAL_SECTION. You might want to try SRW locks in exclusive mode and see if they improve the performance of your performance-critical code.
Last modified by doug65536 on 5/1/2010 3:53:57 AM
Does not work on CE (How to: Set a Thread Name in Native Code)
This does not work for me on WinCE 6.0 (do not know about any other WinCE versions) and VS2008. The exception is regarded as normal (ie the debugger stops on it if enabled). The same code works when build for Win32.
Last modified by mkromb on 3/30/2010 9:30:22 PM
Can someone explain what "current thread" means in a MULTI-processor box? (Thread.Sleep Method (Int32) (System.Threading))
Can someone explain what "current thread" means in a MULTI-processor box? There might be more than one running thread in an instant. Will Thread.Sleep() suspend all active threads? [gh] Thx for the question, Alex. "Current thread" means "the thread that called this method". This usage is consistent throughout the .NET Framework documentation.  -- GlennThanks.Best regards,Alex
Last modified by Glenn Hackney - MSFT on 4/4/2011 4:37:26 PM
Asynchronously calling a Sub (Making an Asynchronous Call with VBScript (Windows))
There are many examples of asynchronously querying WMI, but I haven't seen anything related to calling a subroutine or function. My thought is calling a subroutine from within a loop to achieve multi-threading functionality. Is it possible to call a sub or function asynchronously?
Last modified by Brett Carroll on 12/23/2009 2:42:40 PM
Tags:  multi  threading  vbscript
Forcing of a Context Switch (Thread.Sleep Method (Int32) (System.Threading))
On page 168 (first edition) of Joe Duffy's Concurrent Programming on Windows (link below), Joe states that "if there are runnable threads at a lower priority [and the duration argument is 0], the calling thread will continue running instead of yielding to the other threads" which introduces a potential problem.It is common to call Sleep(0) to 'force' a context switch, sometimes to avoid deadlocks,
Last modified by LukePuplett on 10/25/2009 11:39:49 PM
Neater code through Lambda expressions (ThreadPool.QueueUserWorkItem Method (WaitCallback) (System.Threading))
The WaitCallback is not necessary since Lambdas and delegates came along. Also note that this method is de-emphasised in CLR 4.0 in favor of Tasks. System.Threading.ThreadPool.QueueUserWorkItem(state => { try { WorkerClass.PerformCostlyOp(state); } catch(Exception e) { // You could react or save the exception to an 'outside' variable // threadExc = e; } final
Last modified by LukePuplett on 10/21/2009 1:13:22 PM
.NET Framework Class LibraryWaitCallback DelegateRepresents a callback method to be executed by a thread pool thread.Namespace:   System.ThreadingAssembly:  mscorlib (in mscorlib.dll) <ComVisibleAttribute(True)> _ Public Delegate Sub WaitCallback ( _ state As Object _ ) Dim instance As New WaitCallback(AddressOf HandlerMethod) [ComVisibleAttribute(true)] public delegate voi
Last modified by Microsoft on 12/16/2009 1:42:27 AM
C# Programming GuideHow to: Create and Terminate Threads (C# Programming Guide)ExampleThis example demonstrates how an auxiliary or worker thread can be created and used to perform processing in parallel with the primary thread. Making one thread wait for another and gracefully terminating a thread are also demonstrated. For background information on multi-threading, see Managed Threading and Usin
Last modified by Microsoft on 11/6/2007 10:05:21 PM
Tags:  threading
Creating a new thread is an operation more expensive than using threads in the long run.Threads should not be created and thrown right away after a short asynchronous operation, use the thread pool if information about and control of a thread is not necessary and it may be delayed until the completion of other tasks assigned to the thread pool.
Last modified by Kea on 11/8/2007 10:48:43 PM
Tags:  threading
Windows Presentation Foundation SamplesManaging Unhandled Exceptions on Secondary UI Threads Sample This sample demonstrates how to manage unhandled exceptions that are thrown on secondary user interface (UI) threads. This sample demonstrates a specific feature of the Windows Presentation Foundation and, consequently, does not follow appl
Last modified by Microsoft on 5/18/2009 11:54:56 PM
Page view tracker