Questions tagged [gpars]

The GPars project offers developers new intuitive and safe ways to handle Java or Groovy tasks concurrently, asynchronously, and distributed by utilizing the power of the Java platform and the flexibility of the Groovy language.

The GPars project is a concurrency framework for Groovy and Java. It provides the following abstraction layers over traditional multi-threading / parallel programming

  • Concurrent collection processing
  • Asynchronous operations
  • Fork/Join abstraction
  • Actor programming model
  • Dataflow concurrency constructs
  • Agent - an thread-safe reference to mutable state
114 questions
0
votes
1 answer

Parallel groovy script (in Jira via Scriptrunner)

I need to parallelize my script (it creates few subtasks) in Jira ServiceDesk that runs via ScriptRunner. I need to find a way for parallel creation tasks because when SomeUser creates task, it takes a long time for waiting while all subtasks…
0
votes
1 answer

Java/GPars - my thread pool seems to get "clogged"

What I'm doing: I'm going through a table of companies in a dbase... each company has a text description field, and inside that field there can be a number of hyperlinks (rarely more than 4). What I want to do is to test these links, using curl,…
mike rodent
  • 14,126
  • 11
  • 103
  • 157
0
votes
0 answers

Grails - GPars - GORM: Duplicate Objects Persisting

I’m having an issue where duplicate records are being persisted using GPars. I have a feeling I’m not using GPars correctly. Does anyone see an issue with this example? This thread suggested using withNewSession, but I'm still seeing the same…
Bistro
  • 56
  • 4
0
votes
1 answer

Groovy Gpars poor parallel performance compared to serial

I'm experiencing worse than expected performance from Groovy Gpars while experimenting with multithreading on an i7-2960xm (4 core hyperthreaded). In my test I've been using a recursive fib calculator to simulate workload: def fibRecursive(int…
inkychris
  • 1,179
  • 2
  • 12
  • 18
0
votes
1 answer

dataflowQueues processing or pipelines only seems to be triggered on df.val request

Looking at Gpars dataflows/pipelines but there is something I don't understand If you look at the example below (I've done this with operators, piplines, chainWith, and hit the same problem). In this example I've used tasks but could just as easily…
WILLIAM WOODMAN
  • 1,185
  • 5
  • 19
  • 36
0
votes
2 answers

Unexpected behaviour skips Agent.send method second time through when delegating methods to Agent protected value

I have been trying to do a small Groovy project, and wanted a ConcurrentLinkedHashSet, but Java doesn't provide one. So I set about creating my own using a Gpars agent to 'protect' an ordinary LinkedHashSet. I then created my wrapper class to hold…
WILLIAM WOODMAN
  • 1,185
  • 5
  • 19
  • 36
0
votes
1 answer

How to make capturing output from an external process thread-safe?

I've written a small method to execute the git command line tool and capture its output: def git(String command) { command = "git ${command}" def outputStream = new StringBuilder() def errorStream = new StringBuilder() def process =…
sschuberth
  • 28,386
  • 6
  • 101
  • 146
0
votes
1 answer

AtomicBoolean parallel version does not work - but Agent version does

I have a method where I tried to parallelise the calc using GPARS and calculate an aggregate boolean 'And' result across the calls. This method is wrapped as a @ActiveObject which will deliver the result as a dataflow - the code below has the…
WILLIAM WOODMAN
  • 1,185
  • 5
  • 19
  • 36
0
votes
1 answer

How to terminate all slave actors via master actor in GPars?

I'd like to have my master actor terminate all slave actors as soon as the first one finishes its work. However, I have no idea how I could send a broadcast from my master to all the slaves. Is there a function or programming pattern for this? …
hsvar
  • 177
  • 4
  • 14
0
votes
0 answers

Groovy parallel sql queries

I'm trying to run parallel sql queries using GPars. But somehow it isn't working as I expected. Since I'm relatively new to groovy/java concurrency I'm not sure how to solve my issue. I following code: def rows = this.sql.rows( "SELECT…
0
votes
1 answer

Gpars withPool method called from Pipeline

I have my GParsPool.withPool implemented in 'PreVerifymanager.groovy' as below. import groovyx.gpars.GParsPool public class PreVerifyManager { static final THREADS = 3; public void callMe() { PreVerifyManager pf = new…
DevOps Junky
  • 287
  • 1
  • 5
  • 22
0
votes
1 answer

Groovy XmlSlurper with Parallel Operation

I am parsing some rss xml feed and need to expand some urls in the description field. Now my code is written as items.collect { it.description = FullText.expand(it.description) return it } In this case, the urls inside are requested one by…
Hao Tan
  • 1,530
  • 2
  • 13
  • 20
0
votes
2 answers

GPars - How do I know if actor is busy?

I'm trying to use GPars in Java to handle messages of a few types. There is one actor for each message type. But message processing takes a lot of time, while messages keep coming. I need to ignore upcoming messages (just throw them away) while…
0
votes
0 answers

ORA-00942 When using GPars withPool in Groovy

I currently process a paginated list with the following command: paginatedList.each { it.update() } However this is slow and I'd like to leverage GPars to update each item concurrently. I have used: GParsPool.withPool { …
0
votes
2 answers

Groovy app with gpars slows after many iterations

I'm using gpars to process a 250M row MySQL database table in parallel. I create 8 gpars threads, 8 independent database connections and divide the data in such a way that each thread operates independently on different ranges of rows...sort of a…
Valerie R
  • 1,769
  • 9
  • 29