> I am somewhat confused. Network Security with OpenSSL states quite
> clearly that OpenSSL handles multithreading and blocking sockets
> fine as long as you give it proper callbacks to acquire locks as
> needed. If you go to the book's site and download the code examples
> ( http://www.opensslbook.com/) it is examples 4-1 and 4-2. Have I
> misread this in some way? Does the multithreading actually not
> work as advertised? o_O

> ~RMC

        It works fine and as advertised. However, it does not work precisely the
same as native TCP does. The problem is when you have code that does a
blocking operation in one thread and a concurrent operation in another
thread on the same SSL session.

        The problem is that a blocking read, for example, might take a long 
time.
At the same time, you might want to do several writes that would complete
immediately. But you can't because the blocking read has to lock the SSL
session.

        Unlike the normal case, native TCP does allow concurrent overlapping
operations on the same object from multiple threads. You can have one thread
block in 'read' for hours while another thread completes many 'write's
instantaneously. If the thread blocked in 'read' held a lock on the
connection, that wouldn't work.

        DS


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to