Questions tagged [pool]

A pool describes a cache of resources that an application can draw from to save instantiation time.

Pools typically refer to database connections but the term can be applied to graphics handles, files and other run-time processes. When the use of such a resource is complete but the application is still running, it will typically return the resource to the pool rather than release it.

1504 questions
5
votes
1 answer

Multiprocessing Pool initializer fails pickling

I am trying to use the multiprocessing.Pool to implement a multithread application. To share some variables I am using a Queue as hinted here: def get_prediction(data): #here the real calculation will be performed .... def mainFunction(): …
zimmerrol
  • 4,872
  • 3
  • 22
  • 41
5
votes
2 answers

Broken pipe while using Jedis Pool

I'm using Jedis to perform a lot of insertions/reads in Redis. The Redis server is using the default configuration. The problem appears when I start using a few threads and the exception is: redis.clients.jedis.exceptions.JedisConnectionException:…
Allexandre S.
  • 111
  • 1
  • 2
  • 9
5
votes
1 answer

Why isn't Mutex unlocking?

I am trying to implement a global object pool for a large Obj type. Here is the code for POOL: static mut POOL: Option>> = None; static INIT: Once = ONCE_INIT; pub struct Obj; Here is how I am accessing and locking POOL: fn…
ethanabrooks
  • 747
  • 8
  • 19
5
votes
0 answers

OSError: [Errno 35] Resource temporarily unavailable

mac os, python2.7 I use multiprocessing, but it failed: In [1]: from multiprocessing import Pool In [2]: pool = Pool(30) OSError Traceback (most recent call…
5
votes
1 answer

Python multiprocessing Pool map and imap

I have a multiprocessing script with pool.map that works. The problem is that not all processes take as long to finish, so some processes fall asleep because they wait until all processes are finished (same problem as in this question). Some files…
avierstr
  • 53
  • 2
  • 4
5
votes
1 answer

python multiprocessing map mishandling of last processes

There is a strange behavior of map when using Python's multiprocessing.Pool. In the example below a pool of 4 processors will work on 28 tasks. This should take seven passes, each taking 4 seconds. However, it takes 8 passes. In the first six passes…
Luis
  • 63
  • 6
5
votes
1 answer

The best way to manage a dynamic goroutine pool

Let's say I have a task provider - readable channel, it may or may not provide a task(depends on work load) Specific is so that there may be no work for hours and then there can be a sudden bump in tasks I want to let my goroutine pool grow from 1…
let4be
  • 1,048
  • 11
  • 30
5
votes
2 answers

which erlang's pool is suitable?

I hope this pool has a capability (or options) for auto reduce its worker's quantity when these are free for a max idle timeout. I have read the doc of poolboy and worker_pool and found there is only maximum worker quantity option, but no option for…
Chen Yu
  • 3,955
  • 1
  • 24
  • 51
5
votes
1 answer

Tomcat JDBC connection resources not released

I have a project that uses Tomcat JDBC connection pool. According to the JDK specification, the Connection.close() method should release the resources of the connection, like Statement and ResultSet. I know that when using connection from pool, the…
Ivan
  • 417
  • 1
  • 4
  • 10
5
votes
2 answers

python multiprocess.Pool show results in order in stdout

In multiprocessing.Pool I am trying to show my prints in the the same order. from multiprocessing import Pool import time def func(arg): time.sleep(0.001) print(arg, end=" ") proc_pool = Pool(4) proc_pool.map(func, range(30)) The output…
AbdealiLoKo
  • 3,261
  • 2
  • 20
  • 36
5
votes
2 answers

Handle memory properly with a pool of structs

I have a program with three pools of structs. For each of them I use a list a of used structs and another one for the unused structs. During the execution the program consumes structs, and returns them back to the pool on demand. Also, there is a…
Carlos Vega
  • 1,341
  • 2
  • 13
  • 35
5
votes
1 answer

How to parallelize a for in python inside a class?

I have a python function funz that returns every time a different array of length p. I need to run this function different times and then to compute the mean of each value. I can do this with a for loop but it takes a lot of times. I am trying to…
Donbeo
  • 17,067
  • 37
  • 114
  • 188
5
votes
1 answer

boost asio: different thread pool for different tasks

There are many examples on the net about creating a simple thread pool such as Sample1 and Sample2 What I wanted to implement though is to have a separate thread pool for different tasks. For example, the app may have a pool of threads for…
TDL
  • 103
  • 6
5
votes
1 answer

python multiprocessing freezing

I am trying to implement multiprocessing with Python. It works when pooling very quick tasks, however, freezes when pooling longer tasks. See my example below: from multiprocessing import Pool import math import time def iter_count(addition): …
hercules.cosmos
  • 265
  • 1
  • 3
  • 10
5
votes
1 answer

Cannot find oracle.ucp.jdbc.PoolDataSourceFactory in Oracle ucp

I want to create Oracle UCP using this code: import oracle.ucp.jdbc.PoolDataSource; import oracle.ucp.jdbc.PoolDataSourceFactory; System.out.println("***** OracleDS_UCP -> start init of PoolDataSource"); PoolDataSource pool =…
Peter Penzov
  • 1,126
  • 134
  • 430
  • 808