Danny Munera <dannymun...@gmail.com> wrote on 04/03/2014 05:40:10 AM:
>
> I'm using the function System.sleep() to activate some functionality
> in my project to be executed each X ms. However, I have some strange
> behavior in this function, because frequently it is returning with
> false (interrupted), and the functionality is not correctly
> executed. I'm getting lots of messages "cannot execute sleep".
>
> I've read the documentation of the sleep function, but i didn't find
> any clue to fix this problem. I also implemented a simple example
> using only the sleep function and It works well, but when I use the
> sleep in my code It doesn't work. I have no idea where I should
> start to search the cause of the problem.
>
> Could you give me some suggestion about how to find the cause of this
problem?
>
Looking at the implementation of sleep, this strongly suggests that some
other part of your program is interrupting the sleeping thread. As Vijay
suggested, you could program around this. This would give you the sleep
behavior you want, but perhaps mask a real (performance) problem in the
rest of your program you should be fixing. I'd try to get a
debugger/logging printfs into the Java/C++ implementations of Thread.sleep
and see if there are hints as to where the interrupts are coming from.
--dave
------------------------------------------------------------------------------
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users