Skip to content

Commit 2929a2e

Browse files
kdebski85mariuszs
authored andcommitted
docs: add thread safety information to README
Fixes #95 Based on PR #128 by @kdebski85.
1 parent 2b4d0f1 commit 2929a2e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ Fairy plFairy = Fairy.create(Locale.forLanguageTag("pl"));
5858
// Polish version
5959
```
6060

61+
## Thread safety
62+
63+
`Fairy` object should not be used concurrently by multiple threads. It is recommended to create `Fairy` instance for each thread.
64+
65+
Some methods are not thread-safe when multiple 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.
66+
6167
## Other samples
6268

6369
Look into [code samples](https://github.com/Devskiller/jfairy/tree/master/src/test/groovy/snippets/)

0 commit comments

Comments
 (0)