[
https://issues.apache.org/jira/browse/CSV-295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17505263#comment-17505263
]
Gary D. Gregory commented on CSV-295:
-------------------------------------
[~lizimo] Gotcha. In the future, please be specific as to which layer you refer
to since you have a mixed stack, in particular, note that Java also has a
Semaphore class.
[~angusdev] I agree with [~lizimo], a modern JVM should be able to effectively
show no performance degradation for this change in a single-threaded
application since there will be no contention on the monitor. This is not a
"breaking change", as both binary and source compatibility is maintained.
> Support for parallelism in CSVPrinter
> -------------------------------------
>
> Key: CSV-295
> URL: https://issues.apache.org/jira/browse/CSV-295
> Project: Commons CSV
> Issue Type: Improvement
> Components: Printer
> Affects Versions: 1.9.0
> Environment:
> https://zio.dev/version-1.x/overview/overview_creating_effects#blocking-synchronous-side-effects
> Reporter: Zimo Li
> Priority: Major
> Fix For: 1.10.0
>
>
> I am trying to write the result of network IO to a CSV file using Scala and
> the ZIO library. The order of the rows does not matter, so I decided to use a
> concurrency of 8.
> Each thread calls {{{}CSVPrinter.printRecord{}}}, and this caused some rows
> to intersect with others. Eventually, I decided to use a
> [Semaphore|https://zio.dev/version-1.x/datatypes/concurrency/semaphore] to
> fix it.
> A locking mechanism for {{printRecord}} can be implemented just like the
> underlying {{FileWriter}} or {{PrintWriter}}.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)