1,686 reputation
612
bio website kdgregory.com
location
age
visits member for 3 years, 7 months
seen Aug 25 at 22:10

Jul
23
comment Algorithm to reverse engineer permutation
Would the source strings "AB", "CD" produce the same set of permutations as "A", "BC", "D"? If no, how will they differ?
Jun
13
comment Why/how does Java use a controlled mechanism to pause threads for GC?
If I interpret your question correctly, you're asking whether having specific sync points inside JIT-compiled code will allow you to put object pointers in registers while you're in that code. If that's correct, then yes, that seems reasonable to me. Moreover, I think you have to do this anyway, since I don't believe that X86 (is that your platform?) supports double-indirection-with-index off the stack (but it's been nearly 30 years, so I could be very wrong about that).
Jun
13
comment Why/how does Java use a controlled mechanism to pause threads for GC?
As for specific mechanism for JIT-compiled code (because suspending an interpreter is also trivial), I suspect that depends on specific version of the JVM. All of which begs the question: why does this matter to you? If it's just interest, I'd suggest reading the source.
Jun
13
comment Why/how does Java use a controlled mechanism to pause threads for GC?
System calls are easy: when you're in a system call you aren't modifying the state of the Java world. You just need to have whatever objects you're using pinned (which is something that has to happen in any JNI call).
Jun
11
comment Why do we need fork to create new process
If you'd like some history, go here and read the section "Process Control" (read the entire thing, it's worth it).
Jun
11
answered Why do we need fork to create new process
Jun
5
answered Writing a method to 'transform' an immutable object: how should I approach this?
Jun
5
comment Recursion VS memory allocation
@Phoshi - while everything you say is correct, if I saw an iterative tree traversal in real-world code I would ever-after consider the developer completely incompetent. Because the only way that a tree can blow even a small stack is if it's pathologically unbalanced. In which case either (1) the developer should have figured out why it's unbalanced, or (2) the developer should have realized that a tree was an inappropriate data structure.
Jun
5
comment Recursion VS memory allocation
@Phoshi - and in the "real world" that I live in, there are datasets that will blow your heap. What's your point?
Jun
5
comment Best Practice: What can be the hashCode() method implementation if custom field used in equals() method are null?
So you're willing to pay the price of string concatenation for every test against a hash table?
Jun
5
comment Recursion VS memory allocation
Actually, to go a little deeper: this example is recursive by nature; you have to do extra work to make it iterative. In the "real world," only an idiot or jerk would use the second approach. There are, however, a large number of cases where the problem can be solved equally well both ways. And in those cases, it depends on the mindset of the programmer; any responses you'd get are opinions.
Jun
5
comment Recursion VS memory allocation
No, the main question is how maintainable and readable the code is. And if you have a language that provides a stack, I would argue that adding your own stack decreases maintainability and readability. Although it might increase job security.
Jun
3
comment Processing a list of atomic operations, allowing for interruptions
If you aren't simply looking for a name, but actually for a solution, I'd suggest a database or persistent queue.
Jun
3
comment Processing a list of atomic operations, allowing for interruptions
If you need a pattern name to represent what you're doing, Command (GoF) should suffice. Otherwise Unit of Work (from Fowler's Patterns of Enterprise Application Architecture). Neither is a perfect fit.
Jun
3
comment Are there advantages for using recursion over iteration - other than sometimes readability and elegance?
Try implementing QuickSort without recursion. It can be done -- I've done it -- but doing so will give you a better understanding of why recursion.
May
30
comment Why do XML namespace URIs use the http scheme?
As a side note, several years ago I submitted an enhancement request to Sun to register a "java" namespace that could by used for serialized Java classes. Never got a followup email, and a quick search doesn't show it at the bug database.
May
30
comment Why do XML namespace URIs use the http scheme?
@PhilPatterson - It denotes an "experimental" namespace: one that doesn't have to be registered with the IANA. See RFC3406 for more information.
May
29
answered What are the benefits of using a 'decorator factory' that decorates objects?
May
29
answered Why do XML namespace URIs use the http scheme?
May
23
awarded  Enlightened