immutability
Can functional/immutable data structures still be useful for concurrency in a non-garbage collected context?
One of the selling points of immutable data structures is that they are automatically parallelizable.If no mutation is going on, then references to a functional data structure can be passed around bet[详细]
2023-03-31 18:15 分类:问答Public Properties & Immutability
Is there a better way of ensuring immutability of the following Test class without returnin a new deep copy of the array every time property Array gets acessed (please assume that DeepCopy() is an ext[详细]
2023-03-31 13:16 分类:问答Why does Rectangle.Size create new instances at every call?
Looking into the .NET code, Rectangle.Size returns new Size(Width, Height). Why did Microsoft choose this pattern? Personally, I would have thought that Size would be stored within the structure, and[详细]
2023-03-31 00:21 分类:问答Create postgresql index on text column casted to array
I have a postgresql table that has a column with data type = \'text\' in which I need to create an index which involves this column being type casted to integer[]. However, whenever I tr开发者_StackOv[详细]
2023-03-30 07:40 分类:问答Is registering / unregistering to a .NET event a constant time operation?
Initially, I had assumed yes, because I understood that the invocation list for a multi-cast delegate is implemented as a linked list, which supports constant time insertion and deletion. However, sin[详细]
2023-03-29 18:08 分类:问答How can i make a class Immutable if it has a instance variable of java.lang.Object?
final public class ImmutableWithObject { final Object obj; final List myList; ImmutableWithObject(Object obj1, List list)[详细]
2023-03-29 15:02 分类:问答final fields and thread-safety
Should it be all fields, including super-fields, of a purposely immutable java class \'final\' in order to be thread-safe or开发者_开发技巧 is it enough to have no modifier methods?[详细]
2023-03-29 14:05 分类:问答If delegates are immutable, why can I do things like x += y?
Reading C# In Depth, 2nd edition, section 2.1.2 on combining and removing delegates. The subsection title states that \"delegates are immutable\" and that \"nothing about them can be changed.\"In the[详细]
2023-03-28 06:25 分类:问答will a immutable class save memory?
Will an immutable class of my own implementation result in memory savings?That is, if two references need to refer to identical instances, they will reference the s开发者_如何学Goame instance even if[详细]
2023-03-27 20:18 分类:问答Critique of immutable classes with circular references design, and better options
I have a factory class that creates objects with circular references. I\'d like them to be immutable (in some sense of the word) too. So I use the following technique, using a closure of sorts:[详细]
2023-03-27 18:13 分类:问答