<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/libstd/sync/deque.rs, branch master</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=master</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2014-12-05T08:53:22+00:00</updated>
<entry>
<title>std: Rewrite the `sync` module</title>
<updated>2014-12-05T08:53:22+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-11-24T19:16:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=71d4e77db8ad4b6d821da7e5d5300134ac95974e'/>
<id>urn:sha1:71d4e77db8ad4b6d821da7e5d5300134ac95974e</id>
<content type='text'>
This commit is a reimplementation of `std::sync` to be based on the
system-provided primitives wherever possible. The previous implementation was
fundamentally built on top of channels, and as part of the runtime reform it has
become clear that this is not the level of abstraction that the standard level
should be providing. This rewrite aims to provide as thin of a shim as possible
on top of the system primitives in order to make them safe.

The overall interface of the `std::sync` module has in general not changed, but
there are a few important distinctions, highlighted below:

* The condition variable type, `Condvar`, has been separated out of a `Mutex`.
  A condition variable is now an entirely separate type. This separation
  benefits users who only use one mutex, and provides a clearer distinction of
  who's responsible for managing condition variables (the application).

* All of `Condvar`, `Mutex`, and `RWLock` are now directly built on top of
  system primitives rather than using a custom implementation. The `Once`,
  `Barrier`, and `Semaphore` types are still built upon these abstractions of
  the system primitives.

* The `Condvar`, `Mutex`, and `RWLock` types all have a new static type and
  constant initializer corresponding to them. These are provided primarily for C
  FFI interoperation, but are often useful to otherwise simply have a global
  lock. The types, however, will leak memory unless `destroy()` is called on
  them, which is clearly documented.

* The `Condvar` implementation for an `RWLock` write lock has been removed. This
  may be added back in the future with a userspace implementation, but this
  commit is focused on exposing the system primitives first.

* The fundamental architecture of this design is to provide two separate layers.
  The first layer is that exposed by `sys_common` which is a cross-platform
  bare-metal abstraction of the system synchronization primitives. No attempt is
  made at making this layer safe, and it is quite unsafe to use! It is currently
  not exported as part of the API of the standard library, but the stabilization
  of the `sys` module will ensure that these will be exposed in time. The
  purpose of this layer is to provide the core cross-platform abstractions if
  necessary to implementors.

  The second layer is the layer provided by `std::sync` which is intended to be
  the thinnest possible layer on top of `sys_common` which is entirely safe to
  use. There are a few concerns which need to be addressed when making these
  system primitives safe:

    * Once used, the OS primitives can never be **moved**. This means that they
      essentially need to have a stable address. The static primitives use
      `&amp;'static self` to enforce this, and the non-static primitives all use a
      `Box` to provide this guarantee.

    * Poisoning is leveraged to ensure that invalid data is not accessible from
      other tasks after one has panicked.

  In addition to these overall blanket safety limitations, each primitive has a
  few restrictions of its own:

    * Mutexes and rwlocks can only be unlocked from the same thread that they
      were locked by. This is achieved through RAII lock guards which cannot be
      sent across threads.

    * Mutexes and rwlocks can only be unlocked if they were previously locked.
      This is achieved by not exposing an unlocking method.

    * A condition variable can only be waited on with a locked mutex. This is
      achieved by requiring a `MutexGuard` in the `wait()` method.

    * A condition variable cannot be used concurrently with more than one mutex.
      This is guaranteed by dynamically binding a condition variable to
      precisely one mutex for its entire lifecycle. This restriction may be able
      to be relaxed in the future (a mutex is unbound when no threads are
      waiting on the condvar), but for now it is sufficient to guarantee safety.

* Condvars now support timeouts for their blocking operations. The
  implementation for these operations is provided by the system.

Due to the modification of the `Condvar` API, removal of the `std::sync::mutex`
API, and reimplementation, this is a breaking change. Most code should be fairly
easy to port using the examples in the documentation of these primitives.

[breaking-change]

Closes #17094
Closes #18003
</content>
</entry>
<entry>
<title>Merge libsync into libstd</title>
<updated>2014-11-24T18:51:39+00:00</updated>
<author>
<name>Aaron Turon</name>
<email>aturon@mozilla.com</email>
</author>
<published>2014-11-23T20:52:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=985acfdb67d550d0259fcdcfbeed0a86ec3da9d0'/>
<id>urn:sha1:985acfdb67d550d0259fcdcfbeed0a86ec3da9d0</id>
<content type='text'>
This patch merges the `libsync` crate into `libstd`, undoing part of the
facade. This is in preparation for ultimately merging `librustrt`, as
well as the upcoming rewrite of `sync`.

Because this removes the `libsync` crate, it is a:

[breaking-change]

However, all uses of `libsync` should be able to reroute through
`std::sync` and `std::comm` instead.
</content>
</entry>
<entry>
<title>sync: Move underneath libstd</title>
<updated>2014-06-11T17:00:43+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-06-07T18:13:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b1c9ce9c6f0eb7d4a7df1aad6b6799f4b548181c'/>
<id>urn:sha1:b1c9ce9c6f0eb7d4a7df1aad6b6799f4b548181c</id>
<content type='text'>
This commit is the final step in the libstd facade, #13851. The purpose of this
commit is to move libsync underneath the standard library, behind the facade.
This will allow core primitives like channels, queues, and atomics to all live
in the same location.

There were a few notable changes and a few breaking changes as part of this
movement:

* The `Vec` and `String` types are reexported at the top level of libcollections
* The `unreachable!()` macro was copied to libcore
* The `std::rt::thread` module was moved to librustrt, but it is still
  reexported at the same location.
* The `std::comm` module was moved to libsync
* The `sync::comm` module was moved under `sync::comm`, and renamed to `duplex`.
  It is now a private module with types/functions being reexported under
  `sync::comm`. This is a breaking change for any existing users of duplex
  streams.
* All concurrent queues/deques were moved directly under libsync. They are also
  all marked with #![experimental] for now if they are public.
* The `task_pool` and `future` modules no longer live in libsync, but rather
  live under `std::sync`. They will forever live at this location, but they may
  move to libsync if the `std::task` module moves as well.

[breaking-change]
</content>
</entry>
<entry>
<title>std: Deal with fallout of rtio changes</title>
<updated>2014-06-07T05:19:57+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-06-04T03:09:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=da2293c6f6ea9291749f51a4608d50585be835f0'/>
<id>urn:sha1:da2293c6f6ea9291749f51a4608d50585be835f0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>std: Rename {Eq,Ord} to Partial{Eq,Ord}</title>
<updated>2014-05-30T22:52:24+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-05-30T00:45:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=748bc3ca49de8ab0b890726120c40567094e43fc'/>
<id>urn:sha1:748bc3ca49de8ab0b890726120c40567094e43fc</id>
<content type='text'>
This is part of the ongoing renaming of the equality traits. See #12517 for more
details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord}
or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}.

cc #12517

[breaking-change]
</content>
</entry>
<entry>
<title>std: minor simplification to sync::deque.</title>
<updated>2014-05-24T11:44:37+00:00</updated>
<author>
<name>Huon Wilson</name>
<email>dbau.pp+github@gmail.com</email>
</author>
<published>2014-05-23T15:07:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9a8379deb296b7a8b543fca635c52307d13f6daf'/>
<id>urn:sha1:9a8379deb296b7a8b543fca635c52307d13f6daf</id>
<content type='text'>
</content>
</entry>
<entry>
<title>std,green: Mark some queue types as NoShare</title>
<updated>2014-05-21T23:36:57+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-05-21T01:54:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fdf935a5249edd0be0f14385a099963e43c7a29b'/>
<id>urn:sha1:fdf935a5249edd0be0f14385a099963e43c7a29b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>std: Remove UnsafeArc</title>
<updated>2014-05-20T01:12:18+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-05-20T00:51:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4c8a4d241a984fdc0b8a015dceca2a006f2b7146'/>
<id>urn:sha1:4c8a4d241a984fdc0b8a015dceca2a006f2b7146</id>
<content type='text'>
This type has been superseded by Arc&lt;Unsafe&lt;T&gt;&gt;. The UnsafeArc type is a relic
of an era that has long since past, and with the introduction of liballoc the
standard library is able to use the Arc smart pointer. With little need left for
UnsafeArc, it was removed.

All existing code using UnsafeArc should either be reevaluated to whether it can
use only Arc, or it should transition to Arc&lt;Unsafe&lt;T&gt;&gt;

[breaking-change]
</content>
</entry>
<entry>
<title>std: Rebuild sync::deque on Arc</title>
<updated>2014-05-19T22:51:31+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-05-19T22:51:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=efbd3724c012d68afd428beaa22f0d5aabff007d'/>
<id>urn:sha1:efbd3724c012d68afd428beaa22f0d5aabff007d</id>
<content type='text'>
This also removes the `&amp;mut self` requirement, using the correct `&amp;self`
requirement for concurrent types.
</content>
</entry>
<entry>
<title>sync::deque: port to the new allocator API</title>
<updated>2014-05-11T17:54:53+00:00</updated>
<author>
<name>Daniel Micay</name>
<email>danielmicay@gmail.com</email>
</author>
<published>2014-05-11T09:34:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=420708f38992b488570bc8702a887593a57d746f'/>
<id>urn:sha1:420708f38992b488570bc8702a887593a57d746f</id>
<content type='text'>
</content>
</entry>
</feed>
