mozilla/rust — pull request #4620 by brson (2013-01-25 01:17:12+00:00)
Title: Almost removing oldcomm

r? @graydon

This branch removes most uses of oldcomm. It isn't quite ready but I'm posting it for review to show that I am working on things. Removing the last few usages of oldcomm from std is proving to be time consuming because there's a lot of tricky unsafe code involved. This also won't be mergable until I figure out #4478.

The general strategy:

* Fix #3760 so task spawning has sane behavior. These changes are going to add some more 'service' tasks that spawn lazily and they should not spawn onto random schedulers.
* Add a general `at_exit` facility where the runtime will execute a closure just before shutdown.
* Add a simple, unsafe 'global data' API. It is simply a way to access a global hash table under a mutex. Uses `at_exit` for cleanup.
* Add a new weak task module that uses pipes, at_exit and global data
* Convert users of the old weak task code and `chan_from_global_ptr` to the new interfaces
* Remove the old weak task and `chan_from_global_ptr` functions
* Remove oldcomm

Organizationally, this dumps all the new modules under `core::private`, which I recognize is not right. I intend to reorganize the runtime code as outlined in #2240.