I\'m having issues with finalizers seemingly being called early in a C++/CLI (and C#) project I\'m working on.This seems to be a very complex problem and I\'m going to be mentioning a lot of different
Are Locks auto-closeable? That is, instead of: Lock someLock = new ReentrantLock(); someLock.lock(); try
Let\'s assume we have a process that allocates a socket listening on a specific port, does something with it and then terminates abnormaly. Now a second process starts and wants to allocate a socket l
Suppose I have a pointer to a dynamically allocated array of 10 elements: T* p = new T[10]; Later, I want to release that array:
Basically, I want to open a file, read some bytes, and then close the file. This is what I came up with:
I have a resource object stored in an option. private var ochan: Option[Channel] = None At some point during program execution, ochan is set to Some(channel). I\'d like to close the channel (via i
When reading from a text file, one typically creates a FileReader and then nests that in a BufferedReader. Which of the two readers should I close when I\'m done reading? Does it matter?
interface IMyInterace { void Open(); object Read(); void Close(); } class MyImplementation : IMyInterface { public void Open() { /* instantiates disposible class */ }
I would really appreciate some advise on this matter. e.g. class Foo { TData data; public: TData *getData() { return &data; } // How can we do this in a thread safe manner ?
There are hardware devices which need userspace suppport, like daemon running and handling parts of interaction not suitable (too complex or policy-related) for kernel space.