Message11368

Author stefan.richthofer
Recipients jeff.allen, stefan.richthofer
Date 2017-05-09.12:31:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1494333087.88.0.446400661369.issue2588@psf.upfronthosting.co.za>
In-reply-to
Content
Sorry, I overlooked that you referred to code from a specific test. Somehow I perceived it like the 20 threads-experiment was your own investigation. On a second read it's clear and I wonder how I could have misinterpreted it earlier.

IMO Jython should do some explicit synchronization here and we cannot expect CPython's "solution" to work. However, it looks like this would mean to put a 'synchronized' or lock into f.write(), maybe even cross sync it with read. Not sure how measurable the impact would be for all the common use cases, which don't use extensive multithreading.
(AFAIK, locks from util.concurrent have much lower impact than synchronized, so this might be acceptable.)
I suppose there must be some state of the art way to have thread save file io in Java.
History
Date User Action Args
2017-05-09 12:31:27stefan.richthofersetmessageid: <1494333087.88.0.446400661369.issue2588@psf.upfronthosting.co.za>
2017-05-09 12:31:27stefan.richthofersetrecipients: + stefan.richthofer, jeff.allen
2017-05-09 12:31:27stefan.richthoferlinkissue2588 messages
2017-05-09 12:31:27stefan.richthofercreate