Thursday, June 12, 2003 04:40 PM
Please don't double post. Please use some HTML tags to format your questions so that they are more readable
Wow, this is certainly one of the more interesting questions I've seen go by jGuru in quite a while. My understanding is that you need a way to bundle up a thread and it's state, and move it to a different jvm, where execution could continue. Depending on how you view the problem, Java's Thread is either too high-level, or too low.
- From within the JVM, you would have access to the entire stack and heap that your thread is working with. There are a lot of terrible problems here though, especially with Object values in the heap being kept consistant.
- From withing the existing Java framework, maybe coming up with some sort of Process object is better than trying to make a
java.lang.Thread do something it's not meant to -
Thread.resume() are deprecated, but you need a way to get execution to start at some pre-existing suspended state. If you had one of these mythical Process objects (that you'd have to create), and it had your chain of method calls, kept track of all objects used and guaranteed that they were not referenced from outside it, and enforced all methods used within it were atomic, you might find it's possible.. I guess you could use a preprocessor to mung your java source to insert the necessary code, or you could just provide a set of interfaces, which might be nicer.
Anyway, this is just some idle speculation, just trying to get some thoughts out there. It's an interesting idea, what advantages to you see with this over other existing load balancing technologies? What problem are you trying to solve?