From 83d1680057419229b0708bde59b12159006195cd Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 11 Jul 2013 16:43:43 -0700 Subject: Added a few more thingies to the asset client test to poke the threadpool. --- OpenSim/Tests/Clients/Assets/AssetsClient.cs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Clients/Assets/AssetsClient.cs b/OpenSim/Tests/Clients/Assets/AssetsClient.cs index dd168a1..26d740b 100644 --- a/OpenSim/Tests/Clients/Assets/AssetsClient.cs +++ b/OpenSim/Tests/Clients/Assets/AssetsClient.cs @@ -82,7 +82,16 @@ namespace OpenSim.Tests.Clients.AssetsClient m_log.InfoFormat("[ASSET CLIENT]: [{0}] requested asset {1}", i, uuid); } - Thread.Sleep(20 * 1000); + for (int i = 0; i < 500; i++) + { + var x = i; + ThreadPool.QueueUserWorkItem(delegate + { + Dummy(x); + }); + } + + Thread.Sleep(30 * 1000); m_log.InfoFormat("[ASSET CLIENT]: Received responses {0}", m_NReceived); } @@ -92,8 +101,16 @@ namespace OpenSim.Tests.Clients.AssetsClient m_MaxThreadID = Thread.CurrentThread.ManagedThreadId; int max1, max2; ThreadPool.GetAvailableThreads(out max1, out max2); - m_log.InfoFormat("[ASSET CLIENT]: Received asset {0} ({1}) ({2}-{3})", id, m_MaxThreadID, max1, max2); + m_log.InfoFormat("[ASSET CLIENT]: Received asset {0} ({1}) ({2}-{3}) {4}", id, m_MaxThreadID, max1, max2, DateTime.Now.ToString("hh:mm:ss")); m_NReceived++; } + + private static void Dummy(int i) + { + int max1, max2; + ThreadPool.GetAvailableThreads(out max1, out max2); + m_log.InfoFormat("[ASSET CLIENT]: ({0}) Hello! {1} - {2} {3}", i, max1, max2, DateTime.Now.ToString("hh:mm:ss")); + Thread.Sleep(2000); + } } } -- cgit v1.1