// Main Thread of consequential load profile private void ConsequentialMainThread() { for (int i = 0; i < gl_ConcurrentChats; i++) { string userName = "******" + i.ToString(); StringBuilder sb_helper1 = new StringBuilder(); ChatGeneratorClass chatGen = new ChatGeneratorClass(); gl_ListOfChats.Add(chatGen); gl_ListOfLocalLogs.Add(sb_helper1); chatGen.GenerateClientChat(gl_SiteId, widgetTitle, userName, "CONSEQUENTIAL LOAD: first message!!!", gl_VolumedMsg, gl_VolumizingCount, sb_helper1, userName); } }
// Worker Thread private void HardWorkingMethod(ChatGeneratorClass chatGen, string siteId, string userName, string volumedMsg, int volumizingCount, StringBuilder sb, string threadName) { try { //string line = "----- Thread name: " + threadName + ".\r\n"; //LogAddLine(IDT_LOG, sbLog, msg_thread_start + line); chatGen.GenerateClientChat(siteId, widgetTitle, userName, "Hello, this is my first message!!!", volumedMsg, volumizingCount, sb, threadName); if (gl_ForceClosing) chatGen.GarbageCleaner(); //LogAddLine(IDT_LOG, sbLog, msg_thread_finished + line); } catch (Exception ex) { string err = "EXCEPTION: " + ex.Message; //LogAddLine(IDT_LOG, sbLog, msg_err_thread_failed + err); } }