<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/libstd/sync/mpsc_queue.rs, branch perf-tmp</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=perf-tmp</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=perf-tmp'/>
<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: 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: Move comm primitives away from UnsafeArc</title>
<updated>2014-05-20T00:50:57+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-05-20T00:50:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=73729e94c87281dd7193dbdc86b4de2963b8fd72'/>
<id>urn:sha1:73729e94c87281dd7193dbdc86b4de2963b8fd72</id>
<content type='text'>
They currently still use `&amp;mut self`, this migration was aimed towards moving
from UnsafeArc&lt;T&gt; to Arc&lt;Unsafe&lt;T&gt;&gt;
</content>
</entry>
<entry>
<title>std: Rebuild mpsc queue with Unsafe/&amp;self</title>
<updated>2014-05-20T00:27:52+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-05-20T00:27:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2966e970cabdf7103ad61c840c72bf58352150e0'/>
<id>urn:sha1:2966e970cabdf7103ad61c840c72bf58352150e0</id>
<content type='text'>
This removes the incorrect `&amp;mut self` taken because it can alias among many
threads.
</content>
</entry>
<entry>
<title>core: Remove the cast module</title>
<updated>2014-05-11T08:13:02+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-05-09T17:34:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f94d671bfae5d8e9a4a4add310b1c40af0ab62a6'/>
<id>urn:sha1:f94d671bfae5d8e9a4a4add310b1c40af0ab62a6</id>
<content type='text'>
This commit revisits the `cast` module in libcore and libstd, and scrutinizes
all functions inside of it. The result was to remove the `cast` module entirely,
folding all functionality into the `mem` module. Specifically, this is the fate
of each function in the `cast` module.

* transmute - This function was moved to `mem`, but it is now marked as
              #[unstable]. This is due to planned changes to the `transmute`
              function and how it can be invoked (see the #[unstable] comment).
              For more information, see RFC 5 and #12898

* transmute_copy - This function was moved to `mem`, with clarification that is
                   is not an error to invoke it with T/U that are different
                   sizes, but rather that it is strongly discouraged. This
                   function is now #[stable]

* forget - This function was moved to `mem` and marked #[stable]

* bump_box_refcount - This function was removed due to the deprecation of
                      managed boxes as well as its questionable utility.

* transmute_mut - This function was previously deprecated, and removed as part
                  of this commit.

* transmute_mut_unsafe - This function doesn't serve much of a purpose when it
                         can be achieved with an `as` in safe code, so it was
                         removed.

* transmute_lifetime - This function was removed because it is likely a strong
                       indication that code is incorrect in the first place.

* transmute_mut_lifetime - This function was removed for the same reasons as
                           `transmute_lifetime`

* copy_lifetime - This function was moved to `mem`, but it is marked
                  `#[unstable]` now due to the likelihood of being removed in
                  the future if it is found to not be very useful.

* copy_mut_lifetime - This function was also moved to `mem`, but had the same
                      treatment as `copy_lifetime`.

* copy_lifetime_vec - This function was removed because it is not used today,
                      and its existence is not necessary with DST
                      (copy_lifetime will suffice).

In summary, the cast module was stripped down to these functions, and then the
functions were moved to the `mem` module.

    transmute - #[unstable]
    transmute_copy - #[stable]
    forget - #[stable]
    copy_lifetime - #[unstable]
    copy_mut_lifetime - #[unstable]

[breaking-change]
</content>
</entry>
<entry>
<title>librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, except</title>
<updated>2014-05-07T06:12:54+00:00</updated>
<author>
<name>Patrick Walton</name>
<email>pcwalton@mimiga.net</email>
</author>
<published>2014-05-06T01:56:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=090040bf4037a094e50b03d79e4baf5cd89c912b'/>
<id>urn:sha1:090040bf4037a094e50b03d79e4baf5cd89c912b</id>
<content type='text'>
for `~str`/`~[]`.

Note that `~self` still remains, since I forgot to add support for
`Box&lt;self&gt;` before the snapshot.

How to update your code:

* Instead of `~EXPR`, you should write `box EXPR`.

* Instead of `~TYPE`, you should write `Box&lt;Type&gt;`.

* Instead of `~PATTERN`, you should write `box PATTERN`.

[breaking-change]
</content>
</entry>
<entry>
<title>Replace most ~exprs with 'box'. #11779</title>
<updated>2014-05-03T06:00:58+00:00</updated>
<author>
<name>Brian Anderson</name>
<email>banderson@mozilla.com</email>
</author>
<published>2014-04-25T08:08:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a5be12ce7e88c1d28de1c98215991127d1e765f0'/>
<id>urn:sha1:a5be12ce7e88c1d28de1c98215991127d1e765f0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>std: Switch field privacy as necessary</title>
<updated>2014-03-31T22:17:12+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-03-27T22:09:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9a3d04ae7629f6f273643b3a14f106726842be6a'/>
<id>urn:sha1:9a3d04ae7629f6f273643b3a14f106726842be6a</id>
<content type='text'>
</content>
</entry>
</feed>
