python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Woes with std::shared_ptr<T>.use_counter()
https://en.cppreference.com/w/cpp/memory/shared_ptr/use_count states:
In multithreaded environment, the value returned by use_count is approximate (typical implementations use a memory_order_relaxed ...
Chris Rajula
Votes: 0
Answers: 2
Why does creating a variable name for an exception raised in a Python function affect the reference count of an input variable to that function?
I've defined two simple Python functions that take a single argument, raise an exception, and handle the raised exception. One function uses a variable to refer to the exception before raising/handlin...
Andrew
Votes: 0
Answers: 2
Rc with zero references
Am I able to create an Rc with zero (strong) references? How to do this?
I am doing references counting digraphs. An empty digraph would be represented as an Rc variable with zero references.
If it is...
porton
Votes: 0
Answers: 1
Are generators with context managers an anti-pattern?
I'm wondering about code like this:
def all_lines(filename):
with open(filename) as infile:
yield from infile
The point of a context manager is to have explicit control over the lifetime ...

Homer512
Votes: 0
Answers: 2