Release Indihiang 0.2.1 – Improvement on Parallel Computing Feature

by Agus Kurniawan 8. July 2009 16:11

Thanks for using Indihiang to analyze IIS log files or remote IIS. I try to improve Indihiang application such as features, performance, usability, etc.

Today I uploaded updated Indihiang application version 0.2.1. What’s the improvement in Indihiang 0.2.1? As you know, Indihiang 0.2 used parallel computing feature to analyze log IIS simultaneously. I improved parallel algorithm in Indihiang. Here are the improved codes:

   1: try
   2: {
   3:     var resultData = new Future<List<BaseLogAnalyzeFeature>>[listFiles.Count];
   4:     _mainTask = Task.Create(
   5:             delegate
   6:             {
   7:                 Parallel.For(0, listFiles.Count, index =>
   8:                     {
   9:                         List<BaseLogAnalyzeFeature> features = IndihiangHelper.GenerateParallelFeatures(LogFileFormat);
  10:                         resultData[index] = Future.Create(
  11:                                () => ParseLogFile(features, listFiles[index])
  12:                             );
  13:                         resultData[index].Wait(-1);
  14:                     });
  15:  
  16:             },
  17:             _taskManager.Value,
  18:             TaskCreationOptions.None
  19:          );
  20:  
  21:     _mainTask.Wait(-1);
  22:     for (int i = 0; i < resultData.Length; i++)
  23:     {
  24:         List<BaseLogAnalyzeFeature> items = resultData[i].Value;
  25:         items.ForEach(delegate(BaseLogAnalyzeFeature item)
  26:         {
  27:             for (int j = 0; j < _paralleFeatures.Count; j++)
  28:                 if (_paralleFeatures[j].FeatureName == item.FeatureName)
  29:                     _paralleFeatures[j].SynchData(item.Items);
  30:         });
  31:  
  32:         items.Clear();
  33:         resultData[i].Dispose();
  34:     }
  35:     Thread.Sleep(100);
  36:  
  37: }

 

_mainTask object hold a task all analyzing computation. In this task, I created parallel task using Future<T> object to handle analyzing for a log file. I also passed TaskManager object in _mainTask object to optimize processor usage. I also implemented Lazy initialization for TaskManager object, here is the illustration code as below:

   1: _taskManager = new LazyInit<TaskManager>(() => new TaskManager(
   2:                    new TaskManagerPolicy(1, Environment.ProcessorCount)),
   3:                    LazyInitMode.AllowMultipleExecution);

After all tasks created by Future<T> object, I tried to wait and make sure all tasks completed. After completed, Indihiang consolidated all log IIS files and rendered data on GUI.

 

What’s the Next?

Now, you download Indihiang 0.2.1 for x86 and x64 platforms. You also can download the latest source code on http://indihiang.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29480 

If you have any feedback please report on Indihiang portal http://www.codeplex.com/indihiang

Tags:

Indihiang | .NET

Comments (4) -

Technomarine Mens Moonsun Jubilee
Technomarine Mens Moonsun Jubilee United States
8/14/2009 1:51:41 AM #

I like how you write.Are you interesting in a part time writer job?

Paris Hilton Womens Mini
Paris Hilton Womens Mini United States
8/15/2009 11:57:33 PM #

Tried to autotranslate you site not understand the writing any hope deutsch version?

Womens Timex Bracelet Style
Womens Timex Bracelet Style United States
8/17/2009 9:32:47 PM #

Tried to autotranslate you site not understand the writing any hope deutsch version?

Baume Mercier Classima
Baume Mercier Classima United States
8/26/2009 10:25:59 AM #

I would like to add your blog to my blogroll please tell me what anchor should I use?

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading