From b138a7c2980cb81da521222c8c0ba5c457eac1aa Mon Sep 17 00:00:00 2001 From: kdebski85 Date: Thu, 16 Apr 2020 09:11:15 +0200 Subject: [PATCH 1/2] Add Thread safety information to README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 642067c6..646a1079 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,12 @@ Fairy plFairy = Fairy.create(Locale.forLanguageTag("pl")); // Polish version ``` +## Thread safety + +`Fairy` object should not be used concurrently by multiple threads. It is recommended to create an instance for each thread. +Some method are not thread-safe when mutliple threads share the same `Fairy` object. +For other methods it is still recommended to create a separate `Fairy` object, because `Random` object utilized underneath does not perform well when used concurrently by multiple threads. + ## Other samples Look into [code samples](https://github.com/Devskiller/jfairy/tree/master/src/test/groovy/snippets/) From f7cf2a778bac3e0352bf9c7c68aa929730e36531 Mon Sep 17 00:00:00 2001 From: kdebski85 Date: Thu, 16 Apr 2020 20:48:34 +0200 Subject: [PATCH 2/2] Fix spelling in README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 646a1079..e2f62f67 100644 --- a/README.md +++ b/README.md @@ -62,9 +62,9 @@ Fairy plFairy = Fairy.create(Locale.forLanguageTag("pl")); ## Thread safety -`Fairy` object should not be used concurrently by multiple threads. It is recommended to create an instance for each thread. -Some method are not thread-safe when mutliple threads share the same `Fairy` object. -For other methods it is still recommended to create a separate `Fairy` object, because `Random` object utilized underneath does not perform well when used concurrently by multiple threads. +`Fairy` object should not be used concurrently by multiple threads. It is recommended to create `Fairy` instance for each thread. + +Some methods are not thread-safe when mutliple threads share the same `Fairy` object. For other methods it is still recommended to create a separate `Fairy` object, because `Random` object utilized underneath does not perform well when used concurrently by multiple threads. ## Other samples