[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multi-threading


On Wednesday, 20 December 2017 11:55:04 CET Nikos Mavrogiannopoulos wrote:
> On Wed, 2017-12-20 at 10:38 +0100, Andreas Schneider wrote:
> > On Tuesday, 12 December 2017 01:25:58 CET Ахриев Альберт wrote:
> > > Dear All,
> > > 
> > > As a newcomer I am struggling to understand how to use libssh in
> > > multithreaded environment.
> > > 
> > > Very simple question: if application creates in each thread a
> > > separate
> > > instance of ssh session, which runs completely independently from
> > > other
> > > instances, is that enough to guarantee thread-safety? In other
> > > words, are
> > > the state variables of each session really independent?
> > 
> > No, that's not enough see:
> > 
> > http://api.libssh.org/master/libssh_tutor_threads.html
> 
> Ouch. Is that requirement for libssh or for its back-ends? Other
> (crypto) libraries are using system threads transparently providing
> callbacks exceptionally (or even not). Openssl, libgcrypt, gnutls as
> such examples.

We only provide pthread support. We could detect pthreads and that case use it 
by default. Is that what you mean?


-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx



References:
Re: Multi-threadingAndreas Schneider <asn@xxxxxxxxxxxxxx>
Re: Multi-threadingNikos Mavrogiannopoulos <nmav@xxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org