Re: clojure.data.csv/write-csv isn't thread safe (should it be?)

2019-05-03 Thread Matching Socks
You give credit where none is due! The awe is genuine. Using higher-order functions to avoid writing a loop is old hat. But you went further, and ran *100 threads* without writing a loop. I was so amazed and impressed that an integer overflowed in my brain stem and vectored me off toward Hu

Re: clojure.data.csv/write-csv isn't thread safe (should it be?)

2019-05-02 Thread matt . t . grimm
Well, snark and sarcasm aside, you've made me realize I was way too focused on making write-csv do what I wanted rather than come up with a better solution. So thanks for that, but do try to keep up the impression that this is a friendly, welcoming community. On Thursday, May 2, 2019 at 6:07:53

Re: clojure.data.csv/write-csv isn't thread safe (should it be?)

2019-05-02 Thread Michael Gardner
Note that clojure.core/println is also not "thread-safe" in that sense: two threads doing `(println "foo" "bar")` may produce interleaved output. > On May 2, 2019, at 05:59, matt.t.gr...@gmail.com wrote: > > The write-csv function in clojure.data.csv isn't thread safe because even > though it u

Re: clojure.data.csv/write-csv isn't thread safe (should it be?)

2019-05-02 Thread Matching Socks
Wow, that user.clj is impressive. This is a top-notch application of clojure core async! Nonetheless, if one is going to the trouble of making 100 threads, it would be clearer and farther-sighted (and not much more work) to toss the results into a channel that a single thread drained into an

Re: clojure.data.csv/write-csv isn't thread safe (should it be?)

2019-05-02 Thread Alex Miller
I think the vast majority of the time, people are writing a csv file in a single thread. Issue/patch welcome though... On Thursday, May 2, 2019 at 7:59:05 AM UTC-5, matt@gmail.com wrote: > > The write-csv function in clojure.data.csv isn't thread safe because even > though it uses the synchr

clojure.data.csv/write-csv isn't thread safe (should it be?)

2019-05-02 Thread matt . t . grimm
The write-csv function in clojure.data.csv isn't thread safe because even though it uses the synchronized .write method on BufferedReader, it does so at the cell level , not the row/line level. Is this