none
동적 background workers 생성 시간 지연 발생 이슈 RRS feed

  • 질문

  • 한대의 PC와 다수의 서버에 연결하여 동작하는 통신 프로그램입니다.

    .NET 2.0, C#, Winform application 입니다.

    Client class는 아래와 같이 코딩되어 있습니다.

    public class CMDClient
        {
            private Socket clientSocket;
            private NetworkStream networkStream;
            private BackgroundWorker bwReceiver;
           ...
           /// <summary>
            /// Cretaes a command client instance.
            /// </summary>
            ///<param name="serverIP">The IP of remote server.</param>
            ///<param name="port">The port of remote server.</param>
            /// <param name="netName">The string that will send to the server and then to other clients, to identify this client to all clients.        </param>
          public CMDClient(IPAddress serverIP, int port, string netName)
            {
                this.serverEP = new IPEndPoint(serverIP , port);
                this.networkName = netName;
                System.Net.NetworkInformation.NetworkChange.NetworkAvailabilityChanged += new System.Net.NetworkInformation.NetworkAvailabilityChangedEventHandler(NetworkChange_NetworkAvailabilityChanged);
            }
    ...
          #region private
          private void bwSender_RunWorkerCompleted(object sender , RunWorkerCompletedEventArgs e)
            {
                if ( !e.Cancelled && e.Error == null && ( (bool)e.Result ) )
                    this.OnCommandSent(new EventArgs());
                else
                    this.OnCommandFailed(new EventArgs());
                ( (BackgroundWorker)sender ).Dispose();
                GC.Collect();
            }
            private void bwSender_DoWork(object sender , DoWorkEventArgs e)
            {
                Command cmd = (Command)e.Argument;
                e.Result = this.SendCommandToServer(cmd);
            }
            //This Semaphor is to protect the critical section from concurrent access of sender threads.
            System.Threading.Semaphore semaphor = new System.Threading.Semaphore(1 , 1);
            private bool SendCommandToServer(Command cmd)
            {
                try
                {
                    semaphor.WaitOne();
                    
                    //Command MetaData
                    byte[] metaBuffer = Encoding.ASCII.GetBytes(cmd.MetaData);
                    this.networkStream.Write(metaBuffer , 0 , metaBuffer.Length);
                    this.networkStream.Flush();
                    
                    semaphor.Release();
                    return true;
                }
                catch
                {
                    semaphor.Release();
                    return false;
                }
            }
    ...
          #region public
          /// <summary>
            /// Sends a command to the server if the connection is alive.
            /// </summary>
            /// <param name="cmd">The command to send.</param>
            public void SendCommand(Command cmd)
            {
                if ( this.clientSocket != null && this.clientSocket.Connected )
                {
                    BackgroundWorker bwSender = new BackgroundWorker();
                    bwSender.DoWork += new DoWorkEventHandler(bwSender_DoWork);
                    bwSender.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwSender_RunWorkerCompleted);
                    bwSender.WorkerSupportsCancellation = true;
                    bwSender.RunWorkerAsync(cmd);
                }
                else
                    this.OnCommandFailed(new EventArgs());
            }
    ...
    }

    Form.cs 클래스에서 CMDClient 객체를 50개 정도 생성 하였습니다.

    메시지 전송 시 CMDClient 의 SendCommand 메소드를 호출합니다. 메소드 내부에는 bwSender 라는 BackgroundWorker 를 동적으로 할당합니다.

    문제는 50개의 메시지를 각 서버에 전송 시 bwSender worker를 생성 하는데 시간이 너무 오래 걸린다는 점인데요.

    시간이 오래 걸리는 이유가 무엇인지 모르겠구요. 저의 경우처럼 다수의 서버에 메시지를 동시에 전달할 경우 CMDClient 클래스를 사용할 수 없게 되는 건가요 ?

    • 편집됨 changjurhee 2013년 5월 30일 목요일 오후 5:25
    2013년 5월 30일 목요일 오전 1:03

답변

모든 응답

  • 질문이 잘 이해가 안되는데요. 지금 BackgroundWorker를 new 로 생성하는 것에 시간이 오래 걸린다는 건가요? 아니면 50개로 병렬 처리를 하고 싶었는데, 병렬효과가 없다는 것인가요?

    일단, 위의 코드로 봐서는 new 하는데 오래 걸리지는 않을 것 같습니다. 단지, 다수의 BackgroundWorker를 생성했고, 개별 작업들은 ThreadPool 의 자유스레드를 하나 가져와서 DoWork 에 있는 작업을 처리하게 되는데요. 문제는, 결국 Semaphore로 동기화 처리를 해버렸기 때문에 모든 BackgroundWorker의 작업들이 일렬로 늘어서서 처리하게 된 것입니다. 즉, 단순히 하나의 스레드로 처리하는 것과 별반 다르지 않은 상황인 것입니다.

    2013년 5월 31일 금요일 오전 1:01
  • BackgroundWorker를 new 로 생성하는 것에 시간이 오래 걸린다는 건가요?

    >> 예, new로 생성하는 시간이 오래 걸린다는 말입니다.

    50개로 병렬 처리를 하고 싶었는데, 병렬효과가 없다는 것인가요?

    >> 네, 병렬 효과도 없구요. 제가 Semaphore에 대한 충분한 이해 없이 사용했던 거로군요. 

    비슷한 상황이 하나더 발생하고 있는데요. Live로 측정 데이터를 화면에 뿌려주는 기능을 구현하고 있는데요.

    ClientManager라는 클래스가 있구요.

    class ClientManager 
    {
    private bool _isLive = false;
            public bool IsLive
            {
                get { return _isLive; }
                set { _isLive = value; }
            }
    ...
    ...
    public void ReadDistance(bool isStart)
            {
                if (!_isLive)
                {
                    
                    recipe[indexID].QueueCount = 0;
                    _isLive = isStart;
                    BackgroundWorker bwReadDistance = new BackgroundWorker();
                    bwReadDistance.WorkerSupportsCancellation = true;
                    bwReadDistance.DoWork += new DoWorkEventHandler(bwReadDistance_DoWork);
                    bwReadDistance.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwReadDistance_RunWorkerCompleted);
                    bwReadDistance.RunWorkerAsync();
                }
                else
                {
                   
                    _isLive = isStart;
                }
            }
    ...
     void bwReadDistance_DoWork(object sender, DoWorkEventArgs e)
            {
                BackgroundWorker worker = sender as BackgroundWorker;
                try
                {
                    if (_showDebugConsole)
                        ShowDebug(string.Format("ReadDistance [{0}] >> Start", indexID));
                    while(IsLive)
                    {
                        if ((worker.CancellationPending == true))
                        {
                            e.Cancel = true;
                            break;
                        }
                        else
                        {
                                                        DistanceA data = new DistanceA(recipe[indexID].OpType);
                                data.relevDist = recipe[indexID].RelevDist;
                                data.lastDist1 = recipe[indexID].LastDist1;
                                data.lastDist2 = recipe[indexID].LastDist2;
                                data.currDist1 = recipe[indexID].CurDist1;
                                data.currDist2 = recipe[indexID].CurDist2;
                                recipe[indexID].QueueCount++;
                                lock (_distance.SyncRoot)
                                {
                                    _distance.Enqueue(data);
                                }
                            
                            System.Threading.Thread.Sleep(50);
                        }
                    }
                }
                catch (System.Exception ex)
                {
                    ...
                }
            }
    }

    Form1.cs 클래스에서 아래와같이 ClientManager 클래스의 ReadDistance() 메서드를 호출하는데요. 콘솔에 생성 시간을 측정해 보았습니다.

    public partial class Form1 : Form
        {
    List<ClientManager> clients = new List<ClientManager>();
    ...
    private void Init()
    {
      for (int i = 0; i < recipe.Count; i++)
      {
          ClientManager client = new ClientManager();
          clients.Add(client);
      }
    }
    ...
    private void chkLiveCurrDist_CheckedChanged(object sender, EventArgs e)
            {
                if (chkLiveCurrDist.Checked)
                {
                    for (int i = 0; i < recipe.Count; i++)
                    {
                        clients[i].ReadDistance(true);
                    }
                    if (_showDebugConsole)
                        ShowDebug("Live Start");
                }
                else
                {
                    for (int i = 0; i < recipe.Count; i++)
                    {
                        clients[i].ReadDistance(false);
                    }
                    if (_showDebugConsole)
                        ShowDebug("Live Stop");
                }
            }
    ...
    }

    실행 결과는 아래와 같습니다. 대략 do_work() 실행까지 약 30초가 걸리네요.

    11:59:52.362 오전 Information 0::bwReadDistance_DoWork ReadDistance [0] >> Start 11:59:52.767 오전 Information 2::bwReadDistance_DoWork ReadDistance [2] >> Start 11:59:52.767 오전 Information 1::bwReadDistance_DoWork ReadDistance [1] >> Start 11:59:52.767 오전 Information 3::bwReadDistance_DoWork ReadDistance [3] >> Start 11:59:53.266 오전 Information 4::bwReadDistance_DoWork ReadDistance [4] >> Start 11:59:53.781 오전 Information 5::bwReadDistance_DoWork ReadDistance [5] >> Start 11:59:54.296 오전 Information 6::bwReadDistance_DoWork ReadDistance [6] >> Start 11:59:54.811 오전 Information 7::bwReadDistance_DoWork ReadDistance [7] >> Start 11:59:55.326 오전 Information 8::bwReadDistance_DoWork ReadDistance [8] >> Start 12:00:00.474 오후 Information 17::bwReadDistance_DoWork ReadDistance [17] >> Start 12:00:00.988 오후 Information 18::bwReadDistance_DoWork ReadDistance [18] >> Start 12:00:01.503 오후 Information 19::bwReadDistance_DoWork ReadDistance [19] >> Start 12:00:02.236 오후 Information 20::bwReadDistance_DoWork ReadDistance [20] >> Start 12:00:03.063 오후 Information 21::bwReadDistance_DoWork ReadDistance [21] >> Start 12:00:03.578 오후 Information 22::bwReadDistance_DoWork ReadDistance [22] >> Start 12:00:04.093 오후 Information 23::bwReadDistance_DoWork ReadDistance [23] >> Start 12:00:04.608 오후 Information 24::bwReadDistance_DoWork ReadDistance [24] >> Start 12:00:05.122 오후 Information 25::bwReadDistance_DoWork ReadDistance [25] >> Start 12:00:05.637 오후 Information 26::bwReadDistance_DoWork ReadDistance [26] >> Start 12:00:06.152 오후 Information 27::bwReadDistance_DoWork ReadDistance [27] >> Start 12:00:06.667 오후 Information 28::bwReadDistance_DoWork ReadDistance [28] >> Start 12:00:07.182 오후 Information 29::bwReadDistance_DoWork ReadDistance [29] >> Start 12:00:07.696 오후 Information 30::bwReadDistance_DoWork ReadDistance [30] >> Start 12:00:08.211 오후 Information 31::bwReadDistance_DoWork ReadDistance [31] >> Start 12:00:08.726 오후 Information 32::bwReadDistance_DoWork ReadDistance [32] >> Start 12:00:09.241 오후 Information 33::bwReadDistance_DoWork ReadDistance [33] >> Start 12:00:09.756 오후 Information 34::bwReadDistance_DoWork ReadDistance [34] >> Start 12:00:10.270 오후 Information 35::bwReadDistance_DoWork ReadDistance [35] >> Start 12:00:10.785 오후 Information 36::bwReadDistance_DoWork ReadDistance [36] >> Start 12:00:12.330 오후 Information 37::bwReadDistance_DoWork ReadDistance [37] >> Start 12:00:12.844 오후 Information 38::bwReadDistance_DoWork ReadDistance [38] >> Start 12:00:13.359 오후 Information 39::bwReadDistance_DoWork ReadDistance [39] >> Start 12:00:13.874 오후 Information 40::bwReadDistance_DoWork ReadDistance [40] >> Start 12:00:15.418 오후 Information 41::bwReadDistance_DoWork ReadDistance [41] >> Start 12:00:15.933 오후 Information 42::bwReadDistance_DoWork ReadDistance [42] >> Start 12:00:16.448 오후 Information 43::bwReadDistance_DoWork ReadDistance [43] >> Start 12:00:16.963 오후 Information 44::bwReadDistance_DoWork ReadDistance [44] >> Start 12:00:17.478 오후 Information 45::bwReadDistance_DoWork ReadDistance [45] >> Start 12:00:17.992 오후 Information 46::bwReadDistance_DoWork ReadDistance [46] >> Start 12:00:18.507 오후 Information 47::bwReadDistance_DoWork ReadDistance [47] >> Start 12:00:19.022 오후 Information 48::bwReadDistance_DoWork ReadDistance [48] >> Start 12:00:19.537 오후 Information 49::bwReadDistance_DoWork ReadDistance [49] >> Start 12:00:20.052 오후 Information 50::bwReadDistance_DoWork ReadDistance [50] >> Start

    12:00:27.259 오후 Information 45::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.290 오후 Information 2::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.321 오후 Information 0::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.352 오후 Information 1::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.384 오후 Information 11::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.399 오후 Information 5::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.446 오후 Information 29::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.477 오후 Information 18::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.508 오후 Information 6::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.524 오후 Information 33::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.555 오후 Information 14::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.586 오후 Information 20::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.602 오후 Information 22::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.633 오후 Information 31::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.649 오후 Information 13::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.664 오후 Information 16::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.696 오후 Information 24::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.711 오후 Information 42::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.742 오후 Information 47::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.758 오후 Information 19::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.774 오후 Information 43::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.805 오후 Information 21::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.820 오후 Information 17::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.836 오후 Information 35::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.852 오후 Information 7::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.867 오후 Information 36::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.898 오후 Information 38::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.914 오후 Information 41::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.930 오후 Information 44::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.945 오후 Information 25::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.961 오후 Information 37::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:27.992 오후 Information 23::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.008 오후 Information 26::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.023 오후 Information 28::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.054 오후 Information 12::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.070 오후 Information 34::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.101 오후 Information 9::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.132 오후 Information 27::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.164 오후 Information 4::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.179 오후 Information 39::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.210 오후 Information 32::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.429 오후 Information 3::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.460 오후 Information 8::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.491 오후 Information 40::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.522 오후 Information 10::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.554 오후 Information 50::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.569 오후 Information 30::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.600 오후 Information 15::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.632 오후 Information 46::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.
    12:00:28.663 오후 Information 48::bwReadDistance_RunWorkerCompleted bwReadDistance is completed.


    • 편집됨 changjurhee 2013년 5월 31일 금요일 오전 3:04
    2013년 5월 31일 금요일 오전 1:25
  • ^^ 재미있는 문제군요. 그럼 new 앞 뒤로 Stopwatch 로 시간을 재었을 때 어느 정도 소요되는지 알 수 있을까요?

    2013년 5월 31일 금요일 오전 2:31
  • 06:17:58.141 오후	Information	0::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [0] >> New Front 
    06:17:58.203 오후	Information	0::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [0] >> New Back
    06:17:58.203 오후	Information	1::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [1] >> New Front 
    06:17:58.203 오후	Information	1::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [1] >> New Back
    06:17:58.203 오후	Information	2::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [2] >> New Front 
    06:17:58.203 오후	Information	2::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [2] >> New Back
    06:17:58.203 오후	Information	3::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [3] >> New Front 
    06:17:58.203 오후	Information	3::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [3] >> New Back
    06:17:58.203 오후	Information	4::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [4] >> New Front 
    06:17:58.203 오후	Information	4::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [4] >> New Back
    06:17:58.203 오후	Information	5::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [5] >> New Front 
    06:17:58.203 오후	Information	5::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [5] >> New Back
    06:17:58.203 오후	Information	6::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [6] >> New Front 
    06:17:58.203 오후	Information	6::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [6] >> New Back
    06:17:58.203 오후	Information	7::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [7] >> New Front 
    06:17:58.203 오후	Information	7::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [7] >> New Back
    06:17:58.203 오후	Information	8::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [8] >> New Front 
    06:17:58.203 오후	Information	8::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [8] >> New Back
    06:17:58.203 오후	Information	9::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [9] >> New Front 
    06:17:58.203 오후	Information	9::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [9] >> New Back
    06:17:58.203 오후	Information	10::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [10] >> New Front 
    06:17:58.203 오후	Information	10::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [10] >> New Back
    06:17:58.203 오후	Information	11::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [11] >> New Front 
    06:17:58.203 오후	Information	11::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [11] >> New Back
    06:17:58.203 오후	Information	12::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [12] >> New Front 
    06:17:58.203 오후	Information	12::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [12] >> New Back
    06:17:58.203 오후	Information	13::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [13] >> New Front 
    06:17:58.203 오후	Information	13::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [13] >> New Back
    06:17:58.203 오후	Information	14::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [14] >> New Front 
    06:17:58.203 오후	Information	14::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [14] >> New Back
    06:17:58.203 오후	Information	15::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [15] >> New Front 
    06:17:58.203 오후	Information	15::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [15] >> New Back
    06:17:58.203 오후	Information	16::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [16] >> New Front 
    06:17:58.203 오후	Information	16::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [16] >> New Back
    06:17:58.203 오후	Information	17::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [17] >> New Front 
    06:17:58.203 오후	Information	17::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [17] >> New Back
    06:17:58.203 오후	Information	18::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [18] >> New Front 
    06:17:58.203 오후	Information	18::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [18] >> New Back
    06:17:58.203 오후	Information	19::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [19] >> New Front 
    06:17:58.203 오후	Information	19::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [19] >> New Back
    06:17:58.203 오후	Information	0::bwReadDistance_DoWork	ReadDistance [0] >> Start
    06:17:58.203 오후	Information	20::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [20] >> New Front 
    06:17:58.203 오후	Information	20::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [20] >> New Back
    06:17:58.203 오후	Information	21::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [21] >> New Front 
    06:17:58.203 오후	Information	21::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [21] >> New Back
    06:17:58.203 오후	Information	22::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [22] >> New Front 
    06:17:58.203 오후	Information	22::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [22] >> New Back
    06:17:58.203 오후	Information	23::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [23] >> New Front 
    06:17:58.203 오후	Information	23::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [23] >> New Back
    06:17:58.203 오후	Information	1::bwReadDistance_DoWork	ReadDistance [1] >> Start
    06:17:58.203 오후	Information	24::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [24] >> New Front 
    06:17:58.203 오후	Information	24::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [24] >> New Back
    06:17:58.203 오후	Information	25::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [25] >> New Front 
    06:17:58.203 오후	Information	25::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [25] >> New Back
    06:17:58.203 오후	Information	26::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [26] >> New Front 
    06:17:58.203 오후	Information	26::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [26] >> New Back
    06:17:58.203 오후	Information	27::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [27] >> New Front 
    06:17:58.203 오후	Information	2::bwReadDistance_DoWork	ReadDistance [2] >> Start
    06:17:58.203 오후	Information	27::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [27] >> New Back
    06:17:58.203 오후	Information	28::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [28] >> New Front 
    06:17:58.203 오후	Information	28::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [28] >> New Back
    06:17:58.203 오후	Information	29::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [29] >> New Front 
    06:17:58.203 오후	Information	29::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [29] >> New Back
    06:17:58.203 오후	Information	30::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [30] >> New Front 
    06:17:58.203 오후	Information	30::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [30] >> New Back
    06:17:58.203 오후	Information	31::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [31] >> New Front 
    06:17:58.203 오후	Information	31::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [31] >> New Back
    06:17:58.203 오후	Information	32::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [32] >> New Front 
    06:17:58.203 오후	Information	32::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [32] >> New Back
    06:17:58.203 오후	Information	33::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [33] >> New Front 
    06:17:58.203 오후	Information	33::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [33] >> New Back
    06:17:58.203 오후	Information	34::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [34] >> New Front 
    06:17:58.203 오후	Information	34::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [34] >> New Back
    06:17:58.203 오후	Information	35::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [35] >> New Front 
    06:17:58.203 오후	Information	35::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [35] >> New Back
    06:17:58.203 오후	Information	36::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [36] >> New Front 
    06:17:58.203 오후	Information	36::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [36] >> New Back
    06:17:58.203 오후	Information	37::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [37] >> New Front 
    06:17:58.203 오후	Information	37::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [37] >> New Back
    06:17:58.203 오후	Information	38::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [38] >> New Front 
    06:17:58.203 오후	Information	38::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [38] >> New Back
    06:17:58.203 오후	Information	39::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [39] >> New Front 
    06:17:58.203 오후	Information	39::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [39] >> New Back
    06:17:58.203 오후	Information	40::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [40] >> New Front 
    06:17:58.203 오후	Information	40::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [40] >> New Back
    06:17:58.203 오후	Information	41::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [41] >> New Front 
    06:17:58.203 오후	Information	41::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [41] >> New Back
    06:17:58.203 오후	Information	42::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [42] >> New Front 
    06:17:58.203 오후	Information	42::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [42] >> New Back
    06:17:58.203 오후	Information	43::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [43] >> New Front 
    06:17:58.203 오후	Information	43::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [43] >> New Back
    06:17:58.203 오후	Information	44::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [44] >> New Front 
    06:17:58.203 오후	Information	44::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [44] >> New Back
    06:17:58.203 오후	Information	45::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [45] >> New Front 
    06:17:58.203 오후	Information	45::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [45] >> New Back
    06:17:58.203 오후	Information	46::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [46] >> New Front 
    06:17:58.203 오후	Information	46::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [46] >> New Back
    06:17:58.203 오후	Information	47::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [47] >> New Front 
    06:17:58.203 오후	Information	47::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [47] >> New Back
    06:17:58.203 오후	Information	48::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [48] >> New Front 
    06:17:58.203 오후	Information	48::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [48] >> New Back
    06:17:58.203 오후	Information	49::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [49] >> New Front 
    06:17:58.203 오후	Information	49::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [49] >> New Back
    06:17:58.203 오후	Information	50::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [50] >> New Front 
    06:17:58.203 오후	Information	50::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [50] >> New Back
    06:17:58.312 오후	Information	3::bwReadDistance_DoWork	ReadDistance [3] >> Start
    06:17:58.827 오후	Information	4::bwReadDistance_DoWork	ReadDistance [4] >> Start
    06:17:59.342 오후	Information	5::bwReadDistance_DoWork	ReadDistance [5] >> Start
    06:17:59.857 오후	Information	6::bwReadDistance_DoWork	ReadDistance [6] >> Start
    06:18:00.372 오후	Information	7::bwReadDistance_DoWork	ReadDistance [7] >> Start
    06:18:00.886 오후	Information	8::bwReadDistance_DoWork	ReadDistance [8] >> Start
    06:18:01.401 오후	Information	9::bwReadDistance_DoWork	ReadDistance [9] >> Start
    06:18:01.916 오후	Information	10::bwReadDistance_DoWork	ReadDistance [10] >> Start
    06:18:02.431 오후	Information	11::bwReadDistance_DoWork	ReadDistance [11] >> Start
    06:18:02.946 오후	Information	12::bwReadDistance_DoWork	ReadDistance [12] >> Start
    06:18:03.460 오후	Information	13::bwReadDistance_DoWork	ReadDistance [13] >> Start
    06:18:03.975 오후	Information	14::bwReadDistance_DoWork	ReadDistance [14] >> Start
    06:18:04.490 오후	Information	15::bwReadDistance_DoWork	ReadDistance [15] >> Start
    06:18:05.005 오후	Information	16::bwReadDistance_DoWork	ReadDistance [16] >> Start
    06:18:05.520 오후	Information	17::bwReadDistance_DoWork	ReadDistance [17] >> Start
    06:18:06.034 오후	Information	18::bwReadDistance_DoWork	ReadDistance [18] >> Start
    06:18:06.549 오후	Information	19::bwReadDistance_DoWork	ReadDistance [19] >> Start
    06:18:07.064 오후	Information	20::bwReadDistance_DoWork	ReadDistance [20] >> Start
    06:18:07.579 오후	Information	21::bwReadDistance_DoWork	ReadDistance [21] >> Start
    06:18:08.094 오후	Information	22::bwReadDistance_DoWork	ReadDistance [22] >> Start
    06:18:08.608 오후	Information	23::bwReadDistance_DoWork	ReadDistance [23] >> Start
    06:18:09.123 오후	Information	24::bwReadDistance_DoWork	ReadDistance [24] >> Start
    06:18:09.638 오후	Information	25::bwReadDistance_DoWork	ReadDistance [25] >> Start
    06:18:10.153 오후	Information	26::bwReadDistance_DoWork	ReadDistance [26] >> Start
    06:18:10.668 오후	Information	27::bwReadDistance_DoWork	ReadDistance [27] >> Start
    06:18:11.182 오후	Information	28::bwReadDistance_DoWork	ReadDistance [28] >> Start
    06:18:11.697 오후	Information	29::bwReadDistance_DoWork	ReadDistance [29] >> Start
    06:18:12.212 오후	Information	30::bwReadDistance_DoWork	ReadDistance [30] >> Start
    06:18:12.727 오후	Information	31::bwReadDistance_DoWork	ReadDistance [31] >> Start
    06:18:13.242 오후	Information	32::bwReadDistance_DoWork	ReadDistance [32] >> Start
    06:18:13.756 오후	Information	33::bwReadDistance_DoWork	ReadDistance [33] >> Start
    06:18:14.271 오후	Information	34::bwReadDistance_DoWork	ReadDistance [34] >> Start
    06:18:14.786 오후	Information	35::bwReadDistance_DoWork	ReadDistance [35] >> Start
    06:18:15.301 오후	Information	36::bwReadDistance_DoWork	ReadDistance [36] >> Start
    06:18:15.816 오후	Information	37::bwReadDistance_DoWork	ReadDistance [37] >> Start
    06:18:16.330 오후	Information	38::bwReadDistance_DoWork	ReadDistance [38] >> Start
    06:18:16.845 오후	Information	39::bwReadDistance_DoWork	ReadDistance [39] >> Start
    06:18:17.360 오후	Information	40::bwReadDistance_DoWork	ReadDistance [40] >> Start
    06:18:17.875 오후	Information	41::bwReadDistance_DoWork	ReadDistance [41] >> Start
    06:18:18.390 오후	Information	42::bwReadDistance_DoWork	ReadDistance [42] >> Start
    06:18:18.904 오후	Information	43::bwReadDistance_DoWork	ReadDistance [43] >> Start
    06:18:19.419 오후	Information	44::bwReadDistance_DoWork	ReadDistance [44] >> Start
    06:18:19.934 오후	Information	45::bwReadDistance_DoWork	ReadDistance [45] >> Start
    06:18:20.449 오후	Information	46::bwReadDistance_DoWork	ReadDistance [46] >> Start
    06:18:20.964 오후	Information	47::bwReadDistance_DoWork	ReadDistance [47] >> Start
    06:18:21.478 오후	Information	48::bwReadDistance_DoWork	ReadDistance [48] >> Start
    06:18:21.993 오후	Information	49::bwReadDistance_DoWork	ReadDistance [49] >> Start
    06:18:22.508 오후	Information	50::bwReadDistance_DoWork	ReadDistance [50] >> Start
    06:18:41.743 오후	Information	1::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:41.774 오후	Information	0::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:41.805 오후	Information	32::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:41.821 오후	Information	49::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:41.852 오후	Information	18::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:41.883 오후	Information	8::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:41.914 오후	Information	22::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:41.930 오후	Information	47::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:41.961 오후	Information	45::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:41.992 오후	Information	26::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.024 오후	Information	14::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.039 오후	Information	12::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.070 오후	Information	6::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.102 오후	Information	43::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.133 오후	Information	37::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.164 오후	Information	28::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.195 오후	Information	16::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.211 오후	Information	39::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.242 오후	Information	30::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.273 오후	Information	4::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.304 오후	Information	20::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.320 오후	Information	41::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.351 오후	Information	24::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.382 오후	Information	34::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.414 오후	Information	10::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.445 오후	Information	23::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.460 오후	Information	35::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.492 오후	Information	5::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.523 오후	Information	13::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.554 오후	Information	7::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.570 오후	Information	31::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.601 오후	Information	46::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.632 오후	Information	21::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.663 오후	Information	38::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.679 오후	Information	11::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.710 오후	Information	3::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.741 오후	Information	9::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.772 오후	Information	33::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.882 오후	Information	48::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.897 오후	Information	2::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.928 오후	Information	19::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.960 오후	Information	40::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:42.991 오후	Information	15::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:43.006 오후	Information	25::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:43.038 오후	Information	27::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:43.069 오후	Information	50::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:43.084 오후	Information	36::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:43.116 오후	Information	17::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:43.131 오후	Information	29::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:43.162 오후	Information	44::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:18:43.194 오후	Information	42::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    public void ReadDistance(bool isStart)
            {
                if (!_isLive)
                {
                    
                    recipe[indexID].QueueCount = 0;
                    _isLive = isStart;
                    log.AddInfoLog(this.Name, MethodBase.GetCurrentMethod().Name, string.Format("BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [{0}] >> New Front ", indexID));
                    BackgroundWorker bwReadDistance = new BackgroundWorker();
                    log.AddInfoLog(this.Name, MethodBase.GetCurrentMethod().Name, string.Format("BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [{0}] >> New Back", indexID));
                    bwReadDistance.WorkerSupportsCancellation = true;
                    bwReadDistance.DoWork += new DoWorkEventHandler(bwReadDistance_DoWork);
                    bwReadDistance.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwReadDistance_RunWorkerCompleted);
                    bwReadDistance.RunWorkerAsync();
                }
                else
                {
                   
                    _isLive = isStart;
                }
            }

    >> new 앞 뒤로 Stopwatch 로 시간을 재었을 때

    네, 코드 수정하여 돌려봤는데요. New 앞뒤로 시간 차이는 거의 없네요. 60 ms 정도.....

    public void ReadDistance(bool isStart)
            {
                if (!_isLive)
                {
                    
                    recipe[indexID].QueueCount = 0;
                    _isLive = isStart;
                    log.AddInfoLog(this.Name, MethodBase.GetCurrentMethod().Name, string.Format("BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [{0}] >> New Front ", indexID));
                    BackgroundWorker bwReadDistance = new BackgroundWorker();
                    
                    bwReadDistance.WorkerSupportsCancellation = true;
                    bwReadDistance.DoWork += new DoWorkEventHandler(bwReadDistance_DoWork);
                    bwReadDistance.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwReadDistance_RunWorkerCompleted);
                    bwReadDistance.RunWorkerAsync();
                    log.AddInfoLog(this.Name, MethodBase.GetCurrentMethod().Name, string.Format("BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [{0}] >> New Back", indexID));
                }
                else
                {
                   
                    _isLive = isStart;
                }
            }

    RunWorkerAsync() 밑에 시간을 재었는데, 그래도 차이가 없네요.

    06:23:38.816 오후	Information	0::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [0] >> New Front 
    06:23:38.863 오후	Information	0::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [0] >> New Back
    06:23:38.863 오후	Information	1::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [1] >> New Front 
    06:23:38.863 오후	Information	1::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [1] >> New Back
    06:23:38.863 오후	Information	2::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [2] >> New Front 
    06:23:38.863 오후	Information	2::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [2] >> New Back
    06:23:38.863 오후	Information	3::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [3] >> New Front 
    06:23:38.863 오후	Information	3::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [3] >> New Back
    06:23:38.863 오후	Information	4::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [4] >> New Front 
    06:23:38.863 오후	Information	4::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [4] >> New Back
    06:23:38.863 오후	Information	5::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [5] >> New Front 
    06:23:38.863 오후	Information	5::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [5] >> New Back
    06:23:38.863 오후	Information	6::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [6] >> New Front 
    06:23:38.863 오후	Information	6::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [6] >> New Back
    06:23:38.863 오후	Information	7::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [7] >> New Front 
    06:23:38.863 오후	Information	7::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [7] >> New Back
    06:23:38.863 오후	Information	8::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [8] >> New Front 
    06:23:38.863 오후	Information	8::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [8] >> New Back
    06:23:38.863 오후	Information	9::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [9] >> New Front 
    06:23:38.863 오후	Information	9::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [9] >> New Back
    06:23:38.863 오후	Information	10::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [10] >> New Front 
    06:23:38.878 오후	Information	10::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [10] >> New Back
    06:23:38.878 오후	Information	11::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [11] >> New Front 
    06:23:38.878 오후	Information	11::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [11] >> New Back
    06:23:38.878 오후	Information	12::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [12] >> New Front 
    06:23:38.878 오후	Information	12::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [12] >> New Back
    06:23:38.878 오후	Information	13::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [13] >> New Front 
    06:23:38.878 오후	Information	13::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [13] >> New Back
    06:23:38.878 오후	Information	14::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [14] >> New Front 
    06:23:38.878 오후	Information	14::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [14] >> New Back
    06:23:38.878 오후	Information	15::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [15] >> New Front 
    06:23:38.878 오후	Information	15::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [15] >> New Back
    06:23:38.878 오후	Information	16::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [16] >> New Front 
    06:23:38.878 오후	Information	16::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [16] >> New Back
    06:23:38.878 오후	Information	17::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [17] >> New Front 
    06:23:38.878 오후	Information	17::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [17] >> New Back
    06:23:38.878 오후	Information	18::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [18] >> New Front 
    06:23:38.878 오후	Information	0::bwReadDistance_DoWork	ReadDistance [0] >> Start
    06:23:38.878 오후	Information	18::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [18] >> New Back
    06:23:38.878 오후	Information	19::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [19] >> New Front 
    06:23:38.878 오후	Information	19::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [19] >> New Back
    06:23:38.878 오후	Information	20::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [20] >> New Front 
    06:23:38.878 오후	Information	20::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [20] >> New Back
    06:23:38.878 오후	Information	21::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [21] >> New Front 
    06:23:38.878 오후	Information	21::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [21] >> New Back
    06:23:38.878 오후	Information	22::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [22] >> New Front 
    06:23:38.878 오후	Information	1::bwReadDistance_DoWork	ReadDistance [1] >> Start
    06:23:38.878 오후	Information	22::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [22] >> New Back
    06:23:38.878 오후	Information	23::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [23] >> New Front 
    06:23:38.878 오후	Information	23::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [23] >> New Back
    06:23:38.878 오후	Information	24::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [24] >> New Front 
    06:23:38.878 오후	Information	24::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [24] >> New Back
    06:23:38.878 오후	Information	25::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [25] >> New Front 
    06:23:38.878 오후	Information	25::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [25] >> New Back
    06:23:38.878 오후	Information	26::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [26] >> New Front 
    06:23:38.878 오후	Information	26::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [26] >> New Back
    06:23:38.878 오후	Information	27::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [27] >> New Front 
    06:23:38.878 오후	Information	27::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [27] >> New Back
    06:23:38.878 오후	Information	28::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [28] >> New Front 
    06:23:38.878 오후	Information	28::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [28] >> New Back
    06:23:38.878 오후	Information	29::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [29] >> New Front 
    06:23:38.878 오후	Information	29::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [29] >> New Back
    06:23:38.878 오후	Information	30::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [30] >> New Front 
    06:23:38.878 오후	Information	30::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [30] >> New Back
    06:23:38.878 오후	Information	31::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [31] >> New Front 
    06:23:38.878 오후	Information	31::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [31] >> New Back
    06:23:38.878 오후	Information	32::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [32] >> New Front 
    06:23:38.878 오후	Information	32::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [32] >> New Back
    06:23:38.878 오후	Information	33::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [33] >> New Front 
    06:23:38.878 오후	Information	33::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [33] >> New Back
    06:23:38.878 오후	Information	34::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [34] >> New Front 
    06:23:38.878 오후	Information	34::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [34] >> New Back
    06:23:38.878 오후	Information	35::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [35] >> New Front 
    06:23:38.878 오후	Information	35::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [35] >> New Back
    06:23:38.878 오후	Information	2::bwReadDistance_DoWork	ReadDistance [2] >> Start
    06:23:38.878 오후	Information	36::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [36] >> New Front 
    06:23:38.878 오후	Information	36::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [36] >> New Back
    06:23:38.878 오후	Information	37::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [37] >> New Front 
    06:23:38.878 오후	Information	37::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [37] >> New Back
    06:23:38.878 오후	Information	38::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [38] >> New Front 
    06:23:38.878 오후	Information	38::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [38] >> New Back
    06:23:38.878 오후	Information	39::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [39] >> New Front 
    06:23:38.878 오후	Information	39::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [39] >> New Back
    06:23:38.878 오후	Information	40::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [40] >> New Front 
    06:23:38.878 오후	Information	40::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [40] >> New Back
    06:23:38.878 오후	Information	41::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [41] >> New Front 
    06:23:38.878 오후	Information	41::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [41] >> New Back
    06:23:38.878 오후	Information	42::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [42] >> New Front 
    06:23:38.878 오후	Information	42::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [42] >> New Back
    06:23:38.878 오후	Information	43::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [43] >> New Front 
    06:23:38.878 오후	Information	43::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [43] >> New Back
    06:23:38.878 오후	Information	44::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [44] >> New Front 
    06:23:38.878 오후	Information	44::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [44] >> New Back
    06:23:38.878 오후	Information	45::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [45] >> New Front 
    06:23:38.878 오후	Information	45::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [45] >> New Back
    06:23:38.878 오후	Information	46::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [46] >> New Front 
    06:23:38.878 오후	Information	46::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [46] >> New Back
    06:23:38.878 오후	Information	47::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [47] >> New Front 
    06:23:38.878 오후	Information	47::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [47] >> New Back
    06:23:38.878 오후	Information	48::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [48] >> New Front 
    06:23:38.878 오후	Information	48::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [48] >> New Back
    06:23:38.878 오후	Information	49::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [49] >> New Front 
    06:23:38.878 오후	Information	49::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [49] >> New Back
    06:23:38.878 오후	Information	50::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [50] >> New Front 
    06:23:38.878 오후	Information	50::ReadDistance	BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [50] >> New Back
    06:23:39.128 오후	Information	3::bwReadDistance_DoWork	ReadDistance [3] >> Start
    06:23:39.643 오후	Information	4::bwReadDistance_DoWork	ReadDistance [4] >> Start
    06:23:40.157 오후	Information	5::bwReadDistance_DoWork	ReadDistance [5] >> Start
    06:23:40.672 오후	Information	6::bwReadDistance_DoWork	ReadDistance [6] >> Start
    06:23:41.187 오후	Information	7::bwReadDistance_DoWork	ReadDistance [7] >> Start
    06:23:41.702 오후	Information	8::bwReadDistance_DoWork	ReadDistance [8] >> Start
    06:23:42.217 오후	Information	9::bwReadDistance_DoWork	ReadDistance [9] >> Start
    06:23:42.731 오후	Information	10::bwReadDistance_DoWork	ReadDistance [10] >> Start
    06:23:43.246 오후	Information	11::bwReadDistance_DoWork	ReadDistance [11] >> Start
    06:23:43.761 오후	Information	12::bwReadDistance_DoWork	ReadDistance [12] >> Start
    06:23:44.276 오후	Information	13::bwReadDistance_DoWork	ReadDistance [13] >> Start
    06:23:44.791 오후	Information	14::bwReadDistance_DoWork	ReadDistance [14] >> Start
    06:23:45.305 오후	Information	15::bwReadDistance_DoWork	ReadDistance [15] >> Start
    06:23:45.820 오후	Information	16::bwReadDistance_DoWork	ReadDistance [16] >> Start
    06:23:46.335 오후	Information	17::bwReadDistance_DoWork	ReadDistance [17] >> Start
    06:23:46.850 오후	Information	18::bwReadDistance_DoWork	ReadDistance [18] >> Start
    06:23:47.365 오후	Information	19::bwReadDistance_DoWork	ReadDistance [19] >> Start
    06:23:47.879 오후	Information	20::bwReadDistance_DoWork	ReadDistance [20] >> Start
    06:23:48.394 오후	Information	21::bwReadDistance_DoWork	ReadDistance [21] >> Start
    06:23:48.909 오후	Information	22::bwReadDistance_DoWork	ReadDistance [22] >> Start
    06:23:49.424 오후	Information	23::bwReadDistance_DoWork	ReadDistance [23] >> Start
    06:23:49.939 오후	Information	24::bwReadDistance_DoWork	ReadDistance [24] >> Start
    06:23:50.453 오후	Information	25::bwReadDistance_DoWork	ReadDistance [25] >> Start
    06:23:50.968 오후	Information	26::bwReadDistance_DoWork	ReadDistance [26] >> Start
    06:23:51.483 오후	Information	27::bwReadDistance_DoWork	ReadDistance [27] >> Start
    06:23:51.998 오후	Information	28::bwReadDistance_DoWork	ReadDistance [28] >> Start
    06:23:52.513 오후	Information	29::bwReadDistance_DoWork	ReadDistance [29] >> Start
    06:23:53.027 오후	Information	30::bwReadDistance_DoWork	ReadDistance [30] >> Start
    06:23:53.542 오후	Information	31::bwReadDistance_DoWork	ReadDistance [31] >> Start
    06:23:54.057 오후	Information	32::bwReadDistance_DoWork	ReadDistance [32] >> Start
    06:23:54.572 오후	Information	33::bwReadDistance_DoWork	ReadDistance [33] >> Start
    06:23:55.087 오후	Information	34::bwReadDistance_DoWork	ReadDistance [34] >> Start
    06:23:55.601 오후	Information	35::bwReadDistance_DoWork	ReadDistance [35] >> Start
    06:23:57.146 오후	Information	36::bwReadDistance_DoWork	ReadDistance [36] >> Start
    06:23:57.661 오후	Information	37::bwReadDistance_DoWork	ReadDistance [37] >> Start
    06:23:58.175 오후	Information	38::bwReadDistance_DoWork	ReadDistance [38] >> Start
    06:23:58.690 오후	Information	39::bwReadDistance_DoWork	ReadDistance [39] >> Start
    06:23:59.205 오후	Information	40::bwReadDistance_DoWork	ReadDistance [40] >> Start
    06:23:59.720 오후	Information	41::bwReadDistance_DoWork	ReadDistance [41] >> Start
    06:24:00.235 오후	Information	42::bwReadDistance_DoWork	ReadDistance [42] >> Start
    06:24:00.749 오후	Information	43::bwReadDistance_DoWork	ReadDistance [43] >> Start
    06:24:01.264 오후	Information	44::bwReadDistance_DoWork	ReadDistance [44] >> Start
    06:24:01.779 오후	Information	45::bwReadDistance_DoWork	ReadDistance [45] >> Start
    06:24:02.294 오후	Information	46::bwReadDistance_DoWork	ReadDistance [46] >> Start
    06:24:02.809 오후	Information	47::bwReadDistance_DoWork	ReadDistance [47] >> Start
    06:24:03.323 오후	Information	48::bwReadDistance_DoWork	ReadDistance [48] >> Start
    06:24:03.838 오후	Information	49::bwReadDistance_DoWork	ReadDistance [49] >> Start
    06:24:04.353 오후	Information	50::bwReadDistance_DoWork	ReadDistance [50] >> Start
    06:24:27.269 오후	Information	0::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.301 오후	Information	1::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.316 오후	Information	13::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.332 오후	Information	3::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.347 오후	Information	48::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.363 오후	Information	41::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.379 오후	Information	19::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.394 오후	Information	17::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.410 오후	Information	7::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.425 오후	Information	37::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.441 오후	Information	23::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.457 오후	Information	29::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.472 오후	Information	11::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.472 오후	Information	15::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.488 오후	Information	35::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.503 오후	Information	44::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.519 오후	Information	50::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.535 오후	Information	21::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.550 오후	Information	27::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.566 오후	Information	31::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.581 오후	Information	25::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.597 오후	Information	5::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.613 오후	Information	43::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.628 오후	Information	9::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.644 오후	Information	39::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.644 오후	Information	33::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.659 오후	Information	46::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.675 오후	Information	36::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.691 오후	Information	30::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.706 오후	Information	34::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.722 오후	Information	22::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.737 오후	Information	28::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.753 오후	Information	24::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.769 오후	Information	42::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.784 오후	Information	12::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.800 오후	Information	2::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.800 오후	Information	6::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.815 오후	Information	49::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.831 오후	Information	45::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.847 오후	Information	8::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.862 오후	Information	38::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.878 오후	Information	16::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.893 오후	Information	26::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.909 오후	Information	14::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.925 오후	Information	47::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.940 오후	Information	20::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.956 오후	Information	4::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.971 오후	Information	18::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:27.987 오후	Information	40::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:28.003 오후	Information	10::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.
    06:24:28.018 오후	Information	32::bwReadDistance_RunWorkerCompleted	bwReadDistance is completed.

    결과는 역시 60 ms 인데,

    예를들어, 10번째 클라이언트를 보면 객체 생성은 38초, do_work 실행은 42초에 시작...4초의 갭이 어디서 발생하는 것인지...도무지....

    06:23:38.863 오후 Information 10::ReadDistance BackgroundWorker bwReadDistance = new BackgroundWorker(); Front [10] >> New Front
    06:23:38.878 오후 Information 10::ReadDistance BackgroundWorker bwReadDistance = new BackgroundWorker(); Back [10] >> New Back

    06:23:42.731 오후 Information 10::bwReadDistance_DoWork ReadDistance [10] >> Start

    2013년 5월 31일 금요일 오전 9:29
  • 아래의 글에 정리해 두었으니 참고하세요. ^^

    ThreadPool.QueueUserWorkItem 의 실행 지연
    ; http://www.sysnet.pe.kr/2/0/1455

    2013년 6월 1일 토요일 오전 4:32
  • 답변 감사드립니다.

    사실, 여러 자료를 찾다가 보니 스레드 갯수 지정에 대한 예가 있어서 테스트 해보았는데, 그다지 효과를 보지 못했거든요... 잘때마다 이 생각이었는데... 지금은 또 동작을 하네요. 잉! 무슨 조화인지 모르겠네요. ^^ 몇일 고생한건데요. 암튼, 이렇게 라두 동작을 하니 다행이네요.

    private void chkLiveCurrDist_CheckedChanged(object sender, EventArgs e)
            {
                if (chkLiveCurrDist.Checked)
                {
                    int workerT, portT;
                    int minRequire = 55; // 다른 용도로도 사용될 수 있으므로 안전하게 +5
                    ThreadPool.GetMinThreads(out workerT, out portT);
                    if (_showDebugConsole)
                        ShowDebug(string.Format("Min: worker - {0}, port - {1}", workerT, portT));
                    if (workerT < minRequire)
                    {
                        int inc = minRequire - workerT;
                        workerT += inc;
                    }
                    ThreadPool.SetMinThreads(workerT, portT);
                    if (_showDebugConsole)
                        ShowDebug(string.Format("Min: worker - {0}, port - {1}", workerT, portT));
                    //BuildChartDelegate();
                    if (bwCurrDist.IsBusy != true)
                    {
                        safeStatusStrip.SafeSetText(tss_StatusLabel, "Live Start..");
                        bwCurrDist.RunWorkerAsync();
                    }
                    for (int i = 0; i < recipe.Count; i++)
                    {
                        clients[i].ReadDistance(true);
                    }
                    if (_showDebugConsole)
                        ShowDebug("Live Start");
                }
                else
                {
                    for (int i = 0; i < recipe.Count; i++)
                    {
                        clients[i].ReadDistance(false);
                    }
                    if (bwCurrDist.WorkerSupportsCancellation == true)
                    {
                        bwCurrDist.CancelAsync();
                        string fileName = string.Format("{0}.csv", string.Format("{0:yyMMdd-hh-mm-ss}", DateTime.Now));
                        SaveDistanceFile(fileName);
                    }
                    if (_showDebugConsole)
                        ShowDebug("Live Stop");
                }
            }
    동적으로 생성하는 시간이 문제라면 프로그램 초기 로딩 시 BGW를 미리 생성해 두면 되는거 아닌가요 ? 하지만, 이것도 역시 시간 지연이 발생하던데요. 결국 그때그때 마다 최소 스레드 수를 확인하고 적정하게 재지정을 해줘야 하는건지 ? 아님, 설계 자체를 변경(스레드풀, BGW ->스레드) 해야만 하는건지 ?
    2013년 6월 3일 월요일 오전 12:46
  • BGW를 생성한다고 해서 ThreadPool의 스레드가 증가하는 것은 아닙니다. RunWorkerAsync까지 불러주어야 ThreadPool에 반영이 됩니다.

    ThreadPool의 영향을 받지 않으려면, BGW에 준하는 별도의 클래스를 만들어서 내부적으로 Thread를 이용하도록 하면 될 것입니다. 그런데, 필요한 BGW의 수가 그다지 큰 폭으로 변하는 것이 아니라면, 대강의 스레드 수를 넉넉하게 지정하고 처리해도 되기 때문에 굳이 바꿀 필요는 없을 것 같습니다.

    2013년 6월 3일 월요일 오전 1:28