VS2008 → Tools → Source Control → Visual Studio Foundation Service → Configure User Tools:
|
Thursday, June 25, 2009
Use Beyond Compare with Team Foundation Server in VS 2008/VS2005
Sunday, June 21, 2009
ThreadPool.QueueUserWorkItem() could be very slow
ThreadPool.QueueUserWorkItem() could be very slow if callback being executed as a work item calls Thread.Sleep(). Consider the following example:
The problem is that thread pool waits around 500 ms before allocating a new thread.
You may solve it by pre-specifying a minimal amount of threads in your application:
ThreadPool.SetMinThreads(20, 200);
- using System;
- using System.Threading;
- namespace Test
- {
- class Program
- {
- const int waitTime = 10000;
- static void Main(string[] args)
- {
- for (int i = 0; i < 10; i++ )
- ThreadPool.QueueUserWorkItem( TestProc, i);
- Console.ReadKey();
- }
- static void TestProc(object stateInfo)
- {
- Console.WriteLine("Item number #{0} at {1}", (int)stateInfo, DateTime.Now);
- Thread.Sleep(waitTime);
- }
- }
- }
The problem is that thread pool waits around 500 ms before allocating a new thread.
You may solve it by pre-specifying a minimal amount of threads in your application:
ThreadPool.SetMinThreads(20, 200);
Wednesday, June 17, 2009
Howto: publish metadata for net.tcp endpoint and add reference to WCF service hosted in process/service/console
|
Metadata contains a reference that cannot be resolved net.tcp
Error "Metadata contains a reference that cannot be resolved: 'service reference'. If the service is defined in the current solution, try building the solution and adding the service reference again." could be caused by specifying specific contract rather than IMetadataExchange in Contract section of service endpoint configuration. |
Barrier multithreading primitive in C#
|
Subscribe to:
Posts (Atom)
