View Complete Post
I need the funcitonality to have two methods run concurrently of each other and the parent thread (aka the method that makes these two calls) to halt until BOTH are done. After the threads are done, I need to perform logic on the returns of the method, so it is essential for both of them to be complete before the parent thread continues. I have searched the internet and tried varous attacks, and I always come up with the same result, this being the parent thread continues operation after the first thread finishes, leaving the second thread running. Can someone show me a quick example of how I can do this. I have tried checking states of the threads, halting the threads, but I always end up with the same thing. Any help would be great. Thanks.
In this article, the author explores the hyper-threading technology found on newer Intel Pentium 4 processors and demonstrates how adding parallelism to your code can improve performance on hyper-threaded machines. He covers advanced optimizations for hyper-threading and shows a number of useful patterns. Code samples are in C#, but you can apply the same principles in other languages as they apply to both managed and unmanaged applications.
MSDN Magazine June 2005
Critical sections, a mechanism that prohibits more than one thread at a time from executing a particular section of code, is a topic that has not received much attention and thus tends not to be well understood. A solid understanding of critical sections in Windows can really come in handy when you need to track down multithreading performance issues in your code. This articles delves under the hood of critical sections to reveal information useful in finding deadlocks and in pinpointing performance problems. It also includes a handy utility program that shows all of your critical sections and their current states.
Matt Pietrek and Russ Osterlund
MSDN Magazine December 2003
Edited by Nancy Michell
MSDN Magazine February 2002
Visual Basic has always been a language of innovation, but at the same time it's left its proponents wanting certain high-level features. With the upcoming version, Visual Basic .NET, the language takes advantage of the Microsoft .NET Framework to provide several new features that will be vital to developers. This article begins by discussing tracing and error logging in Visual Basic .NET. Next, you'll see how to write a Windows service without third-party help. Monitoring the file system, a previously daunting task, is also covered. Finally, the author ties these concepts together with a sample application that waits for XML files to be deposited in a directory and then imports them into SQL Server database.
MSDN Magazine July 2001
I really need some help (and also some code example), in how to use System.Threading to send emails.
The issue is:
a) I have a function that sends emails;
b) But I don't want to keep the customers waiting for the email being sent;
c) so, I figure it out that the System.Threading is the best way to do that; But I don't know how exactly I cant use it.
PLEASE, i'm VB - not C# - developer, and I really appreciate help in that language.
I can't use Windows Services or SQL Jobs...
Could you help me on this?
In my asp.net web application i have lengthy excution process like word merge. I want to merge the word documents and send to client in a procedure. Basically i am looking for run and forget kind of asynchronous process.
In my for loop i tried to create delegate and rstrat. like this
filenames is a string array, creating in the same loop and assiging values before calling delegate.
MailSender mail = new MailSender();
TestDelegate testdele = new