[prev in list] [next in list] [prev in thread] [next in thread] 

List:       botan-devel
Subject:    [Botan-devel] Thread Questions
From:       lloyd () randombit ! net (Jack Lloyd)
Date:       2010-10-25 14:00:08
Message-ID: 20101025140008.GA9438 () randombit ! net
[Download RAW message or body]


It definitely is sparse, but fortunately the rules are fairly simple:

Objects do not maintain internal locking, so if you want to share
them, you should serialize the access.

The only exception to this is objects which you do not create (for
instance the global state), which will serialize access with mutexes.

It may make sense to share a PRNG, since it's not likely a point of
contention and the entropy polls would be shared, but again, you would
have to serialize access somehow.

BTW, the configuration toggle is "thread_safe", not "thread safe".
Unfortunately the init object cannot safely give an error about
unknown options for backwards compatability reasons (though not that I
think about it, I may break this in 1.9, as it's been a few release
cycles since there were any other options available).

-Jack

On Fri, Oct 22, 2010 at 07:33:34AM -0700, Larry Lindstrom wrote:
>   Hello Folks:
> 
>     Thank you Jack, for a great crypto library.
> 
>     Developing on WinXP, VS2008 Pro, Botan 1.9.10.
> 
>     The paragraph dedicated to threading in Botan's API guide seems a 
> bit sparse.
> 
>     I've gathered that pipes can't be shared among threads.   Can, and 
> should, PRNGs be shared?  Or does each thread get it's own PRNG?
> 
>     I start my app with:
> 
>               Botan::LibraryInitializer botan_init("thread safe");
> 
>     Any other hints for multi-threading?
> 
>                       Thanks
>                       Larry
> 
> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://lists.randombit.net/mailman/listinfo/botan-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic