login about faq

Hello.

I am created network application based to synchronous CkSocketW (Unicode C++). My code - not using CRITICAL_SECTION\Mutex\etc... In range tests show bad TLS performance, i check my application DebugDiag 2 Analysis (Microsoft), he show me next results:

Detected possible blocking or leaked critical section at 0x00000061`bb8b0298 owned by thread 1378 in MyNetworkApp.DMP Impact of this lock 79,18% of threads blocked

Other debuggers show using CRITICAL_SECTION in Chilkat.


Questions:

  • Why your team using CRITICAL_SECTION in ThreadSafe Chilkat?
  • How up TLS performance?

Small test example:

void CkTlsConnect(std::vector<std::wstring> &ipChunk, int port)
{
    for (int i = 0; i < ipChunk.size(); i++)
    {
        std::wstring ip = ipChunk[i];
        if (!ip.empty())
        {
            CkSocketW socket;
            socket.put_SslProtocol(L"TLS 1.0");
            socket.put_HeartbeatMs(0);
            socket.put_KeepAlive(false);
            if (socket.Connect(ip.c_str(), port, true, 5000))
            {
                socket.put_MaxReadIdleMs(5000);
                socket.put_MaxSendIdleMs(5000);
                socket.SendByte(0x01);
                if (socket.ReceiveByte(true))
                {
                    socket.get_ReceivedInt();
                }
                socket.Close(0);
            }
            socket.dispose();
        }
    }
}

void CkTlsTest()
{
    int threadCount = 4000;
    std::vector<std::vector<std::wstring>> ipChunks;

    //
    // getting ip chunks
    //

    std::vector<std::thread> threadList(threadCount);
    for (int i = 0; i < threadCount; i++)
        threadList[i] = std::thread(CkTlsConnect, std::ref(ipChunks[i]), 1528);

    for (int i = 0; i < threadCount; i++)
        threadList[i].join();
}

I am using this Chilkat version: http://chilkatdownload.com/9.5.0.61/chilkat-9.5.0-x86_64-vc12.zip

asked Oct 15 at 20:19

Ivan's gravatar image

Ivan
52

edited Oct 15 at 20:31

@Chilkat, Hello. Maybe I asked the objectionable question? Or question - against the rules? Or the question poorly designed? Tell me please, why not give a comment or an answer? Thank you.

(Nov 01 at 10:57) Ivan
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×65
×60
×6

Asked: Oct 15 at 20:19

Seen: 180 times

Last updated: Nov 01 at 10:57

powered by OSQA