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
3
votes
2 answers

Multithreading/Async download from single FTP server

I need to download many files from a single folder in a single server and so I'm looking for a way to do it quicker. After a little bit of reading it seems that either a multi-threading or asynchronous approach would work, but I can't seem to get…
Jed
  • 638
  • 1
  • 8
  • 17
3
votes
1 answer

c++ thread pool: alternative to std::function for passing functions/lambdas to threads?

I have a thread pool that I use to execute many tiny jobs (millions of jobs, dozens/hundreds of milliseconds each). The jobs are passed in the form of either: std::bind(&fn, arg1, arg2, arg3...) or [&](){fn(arg1, arg2, arg3...);} with the thread…
Tyson
  • 1,226
  • 1
  • 10
  • 33
3
votes
2 answers

Why is sizeof(T) different inside my container allocator than in the allocator alone?

In this code, I get a different sizeof(T) if the allocator is part of a container allocation: #include #include #include class Item { int a; unsigned char b, c, d; int e, f, g; public: Item() { a = b…
3
votes
2 answers

Why do C++ standard library containers use memory pools, if apparently the malloc/free pair does the same job?

I've read that repetitive calls to malloc/free can be expensive and for this reason C++ standard library containers use memory pools rather than calling free in their destructors. Also, I've read, this means that the performance of C++ standard…
user4385532
3
votes
1 answer

How to perform concurrent POST requests with Guzzle?

I need help in following situation: I have to send POST requests to an API endpoint, which can handle requests simultaneous. But takes time for each. To reduce time, I want to send multiple POST request at a time. Here are some code fragments: use…
Glueckstiger
  • 107
  • 1
  • 7
3
votes
2 answers

Using multiprocessing.Pool with exception handling

from multiprocessing import Pool def f(arg): if arg == 1: raise Exception("exception") return "hello %s" % arg p = Pool(4) res = p.map_async(f,(1,2,3,4)) p.close() p.join() res.get() Consider this contrived example where I am creating…
Ankur Agarwal
  • 23,692
  • 41
  • 137
  • 208
3
votes
2 answers

Multithreading in websphere

I have a Multithreading application, so I implemented ExecutorService with a Pool Size of 5 Threads public class SimpleThreadPool { public static void main(String[] args) { ExecutorService executor = Executors.newFixedThreadPool(5); …
Bill
  • 205
  • 2
  • 3
  • 14
3
votes
1 answer

Manage Client Socket Pool

I need to manage long running TCP socket connections to an external server from my Java application. I'm looking for a good socket pool so I will be able to re-use the sockets. There is another solution than org.apache.commons.pool2 ?
Mercer
  • 9,736
  • 30
  • 105
  • 170
3
votes
1 answer

repairing misconfigured mirrored zfs pool

My machine boots from a mirrored zfs pool of two USB devices. The pool used to look like this: sudo zpool status pool: freenas-boot state: ONLINE scan: resilvered 891M in 15h19m with 0 errors on Wed Mar 29 03:29:55 2017 config: NAME …
patmin
  • 117
  • 1
  • 10
3
votes
0 answers

R: No applicable method for 'tbl' error when making a SQL Server query using dplyr and pool

Apologies if this has been answered elsewhere, but I could not find it. With the following code I am connecting to an MS SQL database using the RJDBC mechanism using pooling from the pool…
Paul van Oppen
  • 1,443
  • 1
  • 9
  • 18
3
votes
0 answers

Hive connection pooling mechanism

I am using hive 2.1.0 version. I have a jdbc connection from java side to connect to hive server2. But now i need to create a jdbc connection once and create a datasource pool so that the multiple queries do not create a new connection everytime and…
3
votes
1 answer

Dynamic pool size in multiprocessing?

Is there a way to dynamically adjust the multiprocessing.Pool size? I'm writing a simple server processes that spawns workers to handle new tasks. Using multiprocessing.Process might be better suited (since the number of workers should not be fixed)…
thyrel
  • 453
  • 1
  • 4
  • 13
3
votes
2 answers

BPMN - system lane/pool?

I am modeling some processes to be used by non-IT people (i.e. they need to be as clear as possible but I also don't wanna break any BPMN rules). I attached a mockup of what I'm trying to show => a person performs some steps in the system but it's…
Natalia
  • 157
  • 1
  • 2
  • 8
3
votes
1 answer

Python Multiprocessing imap

today i have again a question about multiprocessing... I have a small example code: import multiprocessing def function(a): v = a**2 w = a**3 x = a**4 y = a**5 z = a**6 b = [1,2,3,4,5,6,7,8,9,10] if __name__ == "__main__": …
John28
  • 723
  • 3
  • 8
  • 12
3
votes
1 answer

Python Multiprocessing Pool.map

I try to read files with multiprocessing in python. Here is a small example: import multiprocessing from time import * class class1(): def function(self, datasheetname): #here i start reading my datasheet if __name__ == '__main__': …
John28
  • 723
  • 3
  • 8
  • 12