AtomicWeakRef

Open
#26 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
rust
Domain
tooling

Research direction

Start by reading the existing AtomicRef API and the linked discussion about the partial implementation. Clarify the ownership, borrowing, blocking, and into_inner semantics for an AtomicWeakRef; done means those behaviors are specified and covered by appropriate tests.

Written by the indexing model from the issue text.

Description

Would it be possible to add a weak reference type to this library that doesn't include a lifetime parameter?
I've been trying to create something similar to "Box" but with thread-safe weak pointers;
or "Arc" but with the ability to into_inner and get the original value out.

Your library almost satisfies my requirements, but the lifetime requirement on the AtomicRef was problematic.

For reference:
https://www.reddit.com/r/rust/comments/1aq8zzf/help_implementing_an_atomic_reference_box_type/

Note that in my partial-implementation, the into_inner function can block until the weak references aren't actively borrowing. Not sure how this behavior would be accomplished in your library.

Dominant language
Rust
Stars
103
Forks
22
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mozilla/atomic_refcell

All issues in mozilla/atomic_refcell

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.