I'm still reviewing the code to understand how it's used, but there are 2 locations you suggested checking. The first was the WaitComplete function. The sleep is only 0.1 seconds, so I doubt that would cause too much problem (whatever the code is intended to do). The second function is WriterThreadLoop and the sleep is apparently 3 seconds. This function could certainly cause problems depending on what it's intended to do.
private void WriterThreadLoop()
{
while (true)
{
try
{
if (sendQueue.Count > 0)
{
byte[] msg = sendQueue.Dequeue();
//Console.WriteLine(">>>>>OUT " + Utility.ByteArrayToString(msg));
Monitor.Enter(comLock);
if (isWaitingChecksum && msg.Length > 1)
{
Monitor.Wait(comLock, 3000);
isWaitingChecksum = false;
}
SendMessage(msg);
...
It looks like the code is intended to send the commands to the X10 device (CM15 in this case). If there is something in the SendQueue then Monitor is started (connecting to the correct port). If the isWaitingChecksum is true or the msg length is greater than 1, then it will wait for 3 seconds. I'm not sure why that's needed, but it should only take 500ms or less to send an X10 message on PLC, so 3000ms seems pretty long.
I tried to reduce the delay to 500ms and recompile, but the compiler complained about errors. Perhaps it would be possible to reduce this and post a test exe for me to try? I'll try using Visual Studio 2010, but if this is a simple thing to try, let me know...