groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <blackd...@gmx.org>
Subject Re: GPARS.withPool, xml.MarkupBuilder, XmlParser and HTTPBuilder
Date Sat, 18 Jun 2016 08:09:08 GMT
On 16.06.2016 09:40, Paolo wrote:
[...]
> So basically I have a closure called fileworker that will process a file
>
> def fileworker = {
>    open file
>    parse file, adjust some values and create XML file using MarkupBuilder
>    parse the created XML file using XmlParser
>    upload file and XML file using HTTPBuilder
> }
>
> and this closure will be used for processing the list in parallel
> (collectParallel)
>
> groovyx.gpars.GParsPool.withPool(threads) {
>                 result = list.collectParallel fileworker
> }
>
> Due to my missing experiences I am a little concerned about thread
> safety when GPARS comes into place ….

fileworker is self-contained from what I see, so you do not have to 
worry about concurrency issues in this case. You have to worry about 
those once you have data shared by multiple threads.

bye Jochen


Mime
View raw message