Re: OpenSSL: threading question

2004-01-06 Thread Frédéric Giudicelli
- Original Message - From: "David Schwartz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 06, 2004 9:34 PM Subject: RE: OpenSSL: threading question > Except that all but one processor would be sitting idle and if any piece of > your code

RE: OpenSSL: threading question

2004-01-06 Thread David Schwartz
> > The irony is that on Windows, with IOCP, it's even more common to have > > concurrent reads and writes to the same socket handled by different > > threads. > > IOCP throws read and write events into the same event queue because you > > associate a socket with a completion port! > IOCP ? Are y

Re: OpenSSL: threading question

2004-01-06 Thread Frédéric Giudicelli
- Original Message - From: "David Schwartz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 06, 2004 11:39 AM Subject: RE: OpenSSL: threading question > > > [I suspect (based on the all-caps spelling of SOCKET and the sample >

Re: OpenSSL: threading question

2004-01-06 Thread Frédéric Giudicelli
- Original Message - From: "Joseph Bruni" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 06, 2004 8:58 AM Subject: Re: OpenSSL: threading question > > On Jan 6, 2004, at 12:47 AM, David Schwartz wrote: > > >> In most cases

RE: OpenSSL: threading question

2004-01-06 Thread David Schwartz
> [I suspect (based on the all-caps spelling of SOCKET and the sample > code provided earlier) that Mr. Giudicelli speaks from a Windows > perspective, which doesn't handle multiple processes very well, and > certainly does not abstract tcp sockets into simple file descriptors > the way unix does.

Re: OpenSSL: threading question

2004-01-06 Thread Joseph Bruni
On Jan 6, 2004, at 12:47 AM, David Schwartz wrote: In most cases multi threads and only one SOCKET don't really get along. I'm not sure why you'd say that. For TCP, reading and writing are totally independent. Using a pool of threads for I/O is quite common to protect against ambush (when an op

RE: OpenSSL: threading question

2004-01-06 Thread David Schwartz
> In any event if you end up having a MUTEX, you would be better > off with only > one thread accessing both queues. Well that's what the mutex gives you. > That would even allow you to implement a priority algo, which wouldn't be > the case with a simple MUTEX. You could give more prior

Re: OpenSSL: threading question

2004-01-05 Thread Frédéric Giudicelli
reads and only one SOCKET don't really get along. Frédéric Giudicelli http://www.newpki.org - Original Message - From: "David Schwartz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 06, 2004 5:56 AM Subject: RE: OpenSSL: threading question

RE: OpenSSL: threading question

2004-01-05 Thread David Schwartz
> Right on ! > > May I ask a silly question? > Why would you do such a weird thing in the first place? (maybe we should > have started from there) :) Because you might have a design where you have a pool of I/O threads and a queue of I/O jobs. Read jobs and write jobs might be thrown into

Re: OpenSSL: threading question

2004-01-05 Thread Frédéric Giudicelli
) considered that libcrypto was in charge to initialize it. I should have double-checked. Frédéric Giudicelli http://www.newpki.org - Original Message - From: "Joseph Bruni" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 06, 2004 3:51 AM Subject:

Re: OpenSSL: threading question

2004-01-05 Thread Frédéric Giudicelli
EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 06, 2004 3:51 AM Subject: Re: OpenSSL: threading question I'm glad this discussion happened about now. I, too, am implementing a query/response system and I've been thinking about putting the read and write cycles into

Re: OpenSSL: threading question

2004-01-05 Thread Joseph Bruni
An excellent reference to OpenSSL programming can be found in the O'Reilly book: http://www.oreilly.com/catalog/openssl/index.html Lot's of really good stuff here about common mistakes (like not initializing mutexes...). The book was written for 0.9.6 with a few references to some features in

Re: OpenSSL: threading question

2004-01-05 Thread Joseph Bruni
I'm glad this discussion happened about now. I, too, am implementing a query/response system and I've been thinking about putting the read and write cycles into different threads. My reason for wanting to do this would be to allow the server, which sends the initial message, waits for a respons

Re: OpenSSL: threading question

2004-01-05 Thread Frédéric Giudicelli
- Original Message - From: "Olia Kerzhner" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 06, 2004 2:51 AM Subject: Re: OpenSSL: threading question > well, I think the orginal thinking behind this design > was efficiency, we move a lot of

Re: OpenSSL: threading question

2004-01-05 Thread Olia Kerzhner
g > > - Original Message - > From: "Olia Kerzhner" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, January 06, 2004 1:18 AM > Subject: Re: OpenSSL: threading question > > > > Ok, I think we're on the same page now.

RE: OpenSSL: threading question

2004-01-05 Thread David Schwartz
> Hello, > does anyone know if it's valid to call SSL_write and > SSL_read silmultaneously from two different threads? Not for the same connection. Otherwise, yes. DS __ OpenSSL Project

Re: OpenSSL: threading question

2004-01-05 Thread Frédéric Giudicelli
TED]> Sent: Tuesday, January 06, 2004 1:18 AM Subject: Re: OpenSSL: threading question > 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

Re: OpenSSL: threading question

2004-01-05 Thread Dr. Stephen Henson
On Tue, Jan 06, 2004, Frédéric Giudicelli wrote: > > > I guess I'm trying to understand why using 2 threads > > wouldn't work. Is it a bug? Is it by design -- where > > is it documented? Do you just know it doesn't work > > from experience? Do you think it would work if I used > > 2 threads,

Re: OpenSSL: threading question

2004-01-05 Thread Olia Kerzhner
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

Re: OpenSSL: threading question

2004-01-05 Thread Dr. Stephen Henson
On Tue, Jan 06, 2004, Frédéric Giudicelli wrote: > > Now that we have dynamic locks it would be possible to do things properly > but > > it hasn't been done yet. > Has it been implemented for usual structs yet ? Because 0.9.7c it still uses > those "ugly" global locks. > Not yet no. It isn't too

Re: OpenSSL: threading question

2004-01-05 Thread Frédéric Giudicelli
- 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 > > >

Re: OpenSSL: threading question

2004-01-05 Thread Frédéric Giudicelli
> Now that we have dynamic locks it would be possible to do things properly but > it hasn't been done yet. Has it been implemented for usual structs yet ? Because 0.9.7c it still uses those "ugly" global locks. > That's been *reported* to work but I haven't tried it myself. Well, I honestly see no