Ok, I think we're on the same page now.  With
Stephen's explanation and your last remark it clicked
into place.  Can't read from 2 threads at the same
time, and SSL doesn't implement locking for it, so
can't call SSL_Read and SSL_Write at the same time. 

Thanks, and sorry for not being quicker on the uptake!
--- Frédéric_Giudicelli <[EMAIL PROTECTED]> wrote:
> ----- Original Message ----- 
> From: "Olia Kerzhner" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 06, 2004 12:16 AM
> Subject: Re: OpenSSL: threading question
> 
> 
> > > > Do you agree that read/write from 2 different
> > > threads
> > > > is acceptable with plain SOCKETs?
> > > It works on writes, not on reads.
> > > Do the test, you will see. The behavior is
> > > unpredictable on blocking and
> > > non-blocking sockets.
> > > It might work 99,9% of the time, it one threads
> > > picks up the datas before
> > > the other, in some cases you might end up with a
> > > dead-lock.
> > > Plus on writes, don't forget the Nagle
> algorithm,
> > > you might have some weird
> > > stuff happening.
> > >
> >
> > Are you talking about 2 threads, when one only
> reads,
> > and another only writes?   I know you can't have 2
> > threads reading at the same time, or writing at
> the
> > same time.
> Ok, you should have mentionned that since the
> beginning :)
> All Stephen and I were trying to tell you, was that
> in some cases using
> SSL_read and SSL_write, you could end up having two
> threads reading from the
> same SOCKET.
> 
> That's why I preconized some subclassing to
> "protect" the access to SSL_read
> and SSL_write.
> 
> Fred.
> 
>
______________________________________________________________________
> OpenSSL Project                                
> http://www.openssl.org
> User Support Mailing List                   
> [EMAIL PROTECTED]
> Automated List Manager                          
[EMAIL PROTECTED]


__________________________________
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to