www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Re: RFC: Thread safety

Re: RFC: Thread safety

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 26 Feb 2010 20:49:38 +0100 (CET)

On Fri, 26 Feb 2010, Peter Stuge wrote:

> Do we want to add locking within libssh2 so that different threads can write
> to different channels in one session independent of each other?

I wouldn't mind it, at least not if we make it done with a mutex-callback
approach so that we don't do the actual locking ourselves.

There are many thread libs and ways to do this, and adding the checks for them
and depending on them will lead to more work, and lots of apps won't even want
the thread libs in the first place.

Having the mutexing done like this is also actually useful even when different
threads are not using the same handles, as OpenSSL and gcrypt both need such
provisions to work properly thread-safe. So it would help making apps more
indepdendent of actual crypto lib in use.

  / daniel.haxx.se
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-02-26

the libssh2 team