Showing posts with label concurrency. Show all posts
Showing posts with label concurrency. Show all posts

Sunday, June 10, 2012

Is javascript guaranteed to be single-threaded?


Javascript is known to be single-threaded in all modern browser implementations, but is that specified in any standard or is it just by tradition? Is it totally safe to assume that javascript is always single-threaded?

Friday, June 8, 2012

What is the most frequent concurrency issue you"ve encountered in Java?


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.

Wednesday, May 2, 2012

can JavaScript flow of execution be interrupted?


I've always thought that, since JavaScript was single-threaded, I could attach event handlers without worrying about the handlers getting executed while I was in the middle of executing code. To my surprise, I found that they could. According to this answer, the 'Unresponsive Script' dialog box can cause events to be raised while the script is still running.

Sunday, March 11, 2012

Why reading a volatile and writing to a field member is not scalable in Java?


Observe the following program written in Java (complete runnable version follows, but the important part of the program is in the snippet a little bit further below):

Thursday, March 8, 2012

Is volatile expensive?


After reading http://gee.cs.oswego.edu/dl/jmm/cookbook.html about the implementation of volatile, especially section "Interactions with Atomic Instructions" I assume that reading a volatile variable without updating it needs a LoadLoad or a LoadStore barrier. Further down the page I see that LoadLoad and LoadStore are effectively no-ops on X86 CPUs. Does this mean that volatile read operations can be done without a explicit cache invalidation on x86, and is as fast a normal variable read (disregarding the reordering constraints of volatile)?

Wednesday, March 7, 2012

Ways to improve performance consistency


In the following example, one thread is sending "messages" via a ByteBuffer which is the consumer is taking. The best performance is very good but its not consistent.

Friday, February 10, 2012

java: concurrent collections


I'm trying to find one or more concurrent collections to use that I can implement the following behavior (the names are contrived for analogy purposes):

Friday, January 13, 2012

Is possible to postpone trigger fire in Quartz?


I have two processes:



Process 1 - implements runnable and can run forever. Process 2 - fires at fixed hour and minute of day (i've created a job that run with Quartz).