This is a poll of sorts about common concurrency problems in Java. An example might be the classic deadlock or race condition or perhaps EDT threading bugs in Swing. I'm interested both in a breadth of possible issues but also in what issues are most common. So, please leave one specific answer of a Java concurrency bug per comment and vote up if you see one you've encountered.
Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Friday, June 8, 2012
What is the most frequent concurrency issue you"ve encountered in Java?
Tuesday, June 5, 2012
Why is there no GIL in the Java Virtual Machine? Why does Python need one so bad?
I'm hoping someone can provide some insight as to what's fundamentally different about the Java Virtual Machine that allows it to implement threads nicely without the need for a Global Interpreter Lock (GIL), while Python necessitates such an evil.
Thursday, May 31, 2012
Java: "implements Runnable' vs. "extends Thread'
From what time I've spent with threads in Java, I've found these two ways to write threads.
Sunday, May 27, 2012
Does PHP have threading?
I found this PECL package called threads , but there is not a release yet. And nothing is coming up on the PHP website.
Wednesday, May 16, 2012
Static analysis tool to detect multithreading problems (deadlocks, race conditions, not-looped wait, etc.)
I am shopping for a STATIC ANALYSIS TOOL that can tell me if our code suffers from deadlocks, race conditions and bad practices in general.
Monday, May 14, 2012
Objective-C: server requests in a thread (like AsyncTask in Android)
I would like to start a server request, you can cancel.
Sunday, May 13, 2012
Are java primitive ints atomic by design or by accident?
Are java primitive integers (int) atomic at all, for that matter? Some experimentation with two threads sharing an int seems to indicate that they are , but of course absence of evidence that they are not does not imply that they are.
Thursday, May 10, 2012
Is there a way to set a Web Worker to low priority?
I am thinking of using Web Workers to provide some background functionality while a user is browsing my website (that's what Web Workers are for, right?). However, I don't want to take the risk of compromising the user experience by causing laggy scrolling, unresponsive controls, etc. Web Workers are mapped on OS threads, hence I would expect some control on the priority of these threads however, as far as I know, there's no such thing in the current API. Do you know a how to accomplish this? Even with a hack?
Monday, May 7, 2012
Why are there no concurrent collections in C#?
I am trying to get an overview of the thread safety theory behind the collections in C#.
Thursday, March 8, 2012
Are Java static initializers thread safe?
I'm using a static code block to initialize some controllers in a regsitry I have. My question is therefore, can I guarantee that this static code block will only absolutely be called once when the class is first loaded? I understand I cannot guarantee when this code block will be called, Im guessing its when the Classloader first loads it. I realize I could synchronize on the class in the static code block, but my guess is this is actually what happens anyway?
Wednesday, March 7, 2012
How to make a Java thread wait for another thread"s output?
I'm making a Java application with an application-logic-thread and a database-access-thread. Both of them persist for the entire lifetime of the application. However, I need to make sure that the app thread waits until the db thread is ready (currently determined by calling dbthread.isReady() ). I wouldn't mind if app thread blocked until the db thread was ready.
Thursday, March 1, 2012
Android Thread Concurrent running threads notify between them
I want to execute the method uploadingDone() after completion of all three threads. The flags are working most of time correct. In rare case all three flags set to true and BLOCK1 get executed twice. All three threads are doing different tasks on different data ( No Concurrent modification can occur).
Tuesday, February 28, 2012
Create a stuck thread (Weblogic)(J2SE)(1.5)
I need to test WLST script that checks for stuck threads across some managed instances on a weblogic deployment. Unfortunately when I need to test, I am unable to get my stuck thread problem to rear its head. How can I intentionally create a stuck thread to test my script's detection with? My thoughts presently have been to sleep a thread for more than my stuck thread limit on Weblogic's settings, but that is also longer than the timeout for webpages. So my request should timeout before the thread ever becomes stuck. Apache commons executor is another idea... Does anyone have an elegant solution to reproducing this ugly issue?
Friday, February 24, 2012
Multithreading in Java Help Needed
Before I go any further, this IS apart of my homework.The part that I am having trouble with however, is not the main point of the assignment.
Thursday, February 16, 2012
What will happen to a handler if the looper it is handling is quit?
I have a thread handler which handles the looper of a "worker" thread. At some point in my Activity's lifecycle, I am calling "quit" method on the worker thread which releases its current looper. Then what will happen to the (worker) thread handler?
Android - Running heavy computations in background and returning the result to an Activity
I have implemented some computationaly heavy functions into my application. Depending on the type of input it can take up to several minutes for a thread to return. During this time, I want the user to be able to work with other activities to perform different tasks (i.e. prepare data for the next run). Then, after the Service has finished it's computations, the user should be notified with a Toast that the result is ready and that he should check back to the Activity he started the Service in. Unfortunately I'm stuck at this point.
Tuesday, February 14, 2012
updated gui application
I need to write an application that will check for something every X time and update it to GUI comtols. I have some little knowledge in java and written some applications before but I've never dealt with stuff like multiple threads and updating the GUI.
Wednesday, January 18, 2012
ThreadPoolExecutor for running AbortableHttpRequest - how to call abort?
I'm running a networking service in android where I direct all my http requests to run and get callbacks from the service when the requests are complete. I run the requests in a ThreadPoolExecutor to limit the number of concurrent requests. As the requests run within the pool, they eventually create an HttpGet or HttpPost, both of which indirectly implement AbortableHttpRequest , which allows one to cancel the connection (say, if it's blocking for a long time).
Monday, January 16, 2012
PHP-CURL curl_multi_exec is it really multithreaded internally?
My question is very simple as stated in title. However I rephrase it again.