You should post a SSCCE. It not only makes it easy for people to help you; it is also a powerful step toward solving your problem yourself. In preparing your SSCCE, you may find that you don't really need help.
Threads can be tricky. You can rarely depend on them for anything. The best place to discover exactly what you can depend on is the Java Language Specification for threads: http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html
When it comes to interleaving of threads, you should remember Item 72 of Effective Java Second Edition: "Don't depend on the thread scheduler." It sounds like you are hoping that your threads will toss the processor back and forth like a hot potato. If that is what you mean by interleaving, then remember Item 72 and force it to happen instead of depending on the thread scheduler to make it happen. Always assume that the thread you least want to be running will be the one chosen by the scheduler; the only way you can stop it from happening is by putting that thread to sleep, such as with
Object.wait, or by forcing it to wait to enter a
synchronized block. A well-behaved thread will stop frequently so that other threads get a chance to run even when the scheduler is doing its best to prevent it. Also, don't expect
Thread.yield to help because all that does is suggest that the scheduler consider choosing another thread to run, which is very little help when the scheduler always chooses the wrong thread.
Edited 3 Years Ago by bguild
I made a prime number finder, it finds the nearest prime that is above and below any integer (Does not work that well with giant numbers.)
Made this in cpp.sh
Why would I need the x=y+1-1;?
x=y; just doesnt seem to work
Why is this?
And I know my coding ...
write a C++ program which take inputs from the user/keyboard and calculate his ZAKAT.
get the input from user may include
-Amount invested in business
-Amount given to other business partners as loan
-Amount payable to others
there are five tables (personTb, addressTb,churchTb) each holds data pertinent to an individual; (personAddress,personChurch) each hold the primary key for the person table and corresponding table IE personAddress holds primary key for addressTb.
both snippets work, my question is; Is my join correctly formatted?
select concat(personTb.p_fName,' ',personTb.p_mName,'. ',personTb.p_lName) ...