How to suspend a java thread for a small period of time, like 100 nanoseconds?

The granularity of sleeps is generally bound by the thread scheduler’s interrupt period. In Linux, this interrupt period is generally 1ms in recent kernels. In Windows, the scheduler’s interrupt period is normally around 10 or 15 milliseconds If I have to halt threads for periods less than this, I normally use a busy wait EDIT: … Read more

What is the difference between message-passing and method-invocation?

Using Objective-C as an example of messages and Java for methods, the major difference is that when you pass messages, the Object decides how it wants to handle that message (usually results in an instance method in the Object being called). In Java however, method invocation is a more static thing, because you must have … Read more

How to execute a method passed as parameter to function

You can just call it as a normal function: function myfunction(param1, callbackfunction) { //do processing here callbackfunction(); } The only extra thing is to mention context. If you want to be able to use the this keyword within your callback, you’ll have to assign it. This is frequently desirable behaviour. For instance: function myfunction(param1, callbackfunction) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)