0 votes
in JAVA by
Which one would be easy to write? synchronization code for 10 threads or 2 threads?

1 Answer

0 votes
by

In terms of writing code, both will be of same complexity because synchronization code is independent of a number of threads. Choice of synchronization though depends upon a number of threads because the number of thread present more contention, so you go for advanced synchronization technique e.g. lock stripping, which requires more complex code and expertise.

Related questions

0 votes
asked Apr 10, 2021 in JAVA by Robindeniel
0 votes
asked Dec 16, 2020 in JAVA by SakshiSharma
...