What’s the difference between a Future and a Promise?
What’s the difference between Future and Promise? They both act like a placeholder for future results, but where is the main difference? 9 Answers 9
What’s the difference between Future and Promise? They both act like a placeholder for future results, but where is the main difference? 9 Answers 9
I am opening a file which has 100,000 URL’s. I need to send an HTTP request to each URL and print the status code. I am using Python 2.6, and so far looked at the many confusing ways Python implements threading/concurrency. I have even looked at the python concurrence library, but cannot figure out how … Read more
Inspired by this question where there are differing views on SET NOCOUNT… Should we use SET NOCOUNT ON for SQL Server? If not, why not? What it does Edit 6, on 22 Jul 2011 It suppresses the “xx rows affected” message after any DML. This is a resultset and when sent, the client must process … Read more
I’m trying to understand what makes the lock in concurrency so important if one can use synchronized (this). In the dummy code below, I can do either: synchronized the entire method or synchronize the vulnerable area (synchronized(this){…}) OR lock the vulnerable code area with a ReentrantLock. Code: private final ReentrantLock lock = new ReentrantLock(); private … Read more
I have not seen clear examples with use-cases for Pool.apply, Pool.apply_async and Pool.map. I am mainly using Pool.map; what are the advantages of others? 3 Answers 3
What is the difference between concurrent programming and parallel programing? I asked google but didn’t find anything that helped me to understand that difference. Could you give me an example for both? For now I found this explanation: http://www.linux-mag.com/id/7411 – but “concurrency is a property of the program” vs “parallel execution is a property of … Read more
The Mutex class is very misunderstood, and Global mutexes even more so. What is good, safe pattern to use when creating Global mutexes? One that will work Regardless of the locale my machine is in Is guaranteed to release the mutex properly Optionally does not hang forever if the mutex is not acquired Deals with … Read more
A semaphore is a programming concept that is frequently used to solve multi-threading problems. My question to the community: What is a semaphore and how do you use it? 15 Answers 15
Can any one tell me the advantage of synchronized method over synchronized block with an example? 23 Answers 23
Does it mean that two threads can’t change the underlying data simultaneously? Or does it mean that the given code segment will run with predictable results when multiple threads are executing that code segment? 17 Answers 17