Commit Graph

47 Commits

Author SHA1 Message Date
Jon Morton 632a4c9326 Refactor includes structure, getting rid of rust_internal.h
Many changes to code structure are included:
- removed TIME_SLICE_IN_MS
- removed sychronized_indexed_list
- removed region_owned
- kernel_owned move to kernel.h, task_owned moved to task.h
- global configs moved to rust_globals.h
- changed #pragma once to standard guard in rust_upcall.h
- got rid of memory.h
2012-04-03 16:02:38 -07:00
Jon Morton 413994ea3e replace assertion macros with plain asserts 2012-04-01 21:14:16 -05:00
Brian Anderson 243790836a rt: Rename rust_task_thread to rust_sched_loop
This class no longer represents a thread; it just schedules tasks.
2012-03-31 19:51:29 -07:00
Brian Anderson b247de6458 rt: Remove lock_held_by_current_thread 2012-03-18 17:03:35 -07:00
Brian Anderson 35e9970e29 rt: Ports don't need to ref their tasks
Port lifetime is always bounded by their owning task
2012-03-17 17:56:15 -07:00
Brian Anderson b278d675a2 rt: Look up ports through a single port table
Instead of a two-level lookup, just use one big table
2012-03-15 11:10:52 -07:00
Marijn Haverbeke d0f5e58e95 Zero out dest ptr when port_recv doesn't return a value 2012-03-15 15:08:30 +01:00
Brian Anderson dc0b9f44e2 rt: Change the rust_port refcounting scheme to avoid races
Hopefully...
2012-03-06 17:14:40 -08:00
Brian Anderson ee991cae81 rt: Add a hack to fix a port detach bug 2012-03-05 20:02:25 -08:00
Brian Anderson 958c321083 rt: Fix the atomic get_ref_count method to avoid races 2012-03-05 19:39:56 -08:00
Brian Anderson 1347d04bb0 rt: Properly block tasks while waiting for port detach 2012-03-05 19:39:56 -08:00
Brian Anderson 4c4a2320eb rt: Make rust_port_detach less contentious
It still utterly dominates some benchmarks with busy waiting, but at least it
doesn't create lock contention while doing so.
2012-03-05 19:39:56 -08:00
Brian Anderson 0a5603cb58 rt: Make linked failure less prone to deadlock
Still a mess.
2012-03-05 19:39:56 -08:00
Brian Anderson e08f46db68 rt: Move receive code into rust_port 2012-03-05 19:39:56 -08:00
Brian Anderson 8e0efce0da rt: Move some code from rust_port_detach into rust_port::detach 2012-03-05 19:39:56 -08:00
Brian Anderson 93fa933a19 rt: Move some locking from rust_port to rust_task 2012-03-05 19:39:56 -08:00
Brian Anderson e3ccac8ed3 rt: Renome rust_task::lock to port_lock 2012-03-05 19:39:55 -08:00
Brian Anderson b2cfb7ef82 rt: Add rust_port_select function 2012-02-16 11:12:22 -08:00
Brian Anderson f94339cc1c rt: Rename rust_scheduler to rust_task_thread 2012-02-03 23:48:12 -08:00
Brian Anderson 342dc21d2c Disconnect ports before draining them. Issue #1155 2011-11-16 17:22:14 -08:00
Brian Anderson f619d5e9e2 rt: Add locking invariants to rust_port 2011-11-13 16:38:34 -08:00
Brian Anderson 138d9ca5d5 Drop enqueued elements when a port is destructed. Closes #1155 2011-11-13 15:43:58 -08:00
Brian Anderson 5d1e321ecb rt: Remove rust_chan 2011-11-11 12:11:21 -08:00
Brian Anderson 793da65a8e rt: Move rust_chan::send to rust_port::send 2011-11-10 17:53:19 -08:00
Brian Anderson 371574f64b rt: Remove rust_token. Unused 2011-11-10 17:35:21 -08:00
Brian Anderson e4f980810b rt: Simplify channel-port association
It turns out that there's only ever a single channel per port these days,
and it always has the same lifetime as the port, so we don't need a list or a
complex association protocol.
2011-11-10 17:26:22 -08:00
Brian Anderson 08d0ff38bc rt: Remove new_chan. Not needed 2011-11-10 15:59:31 -08:00
Marijn Haverbeke 457683c7fe Do not pass taskpointers to "rust" native functions
Issue #466
2011-10-20 14:22:17 +02:00
Eric Holk 39b16077bb Port ID-based channels. 2011-08-15 09:26:51 -07:00
Eric Holk 04af99ecb0 First step towards port handles. 2011-08-15 09:26:51 -07:00
Eric Holk b62e80c1f0 Atomic ref counting for chans. 2011-08-05 15:27:28 -07:00
Eric Holk d1dbb99984 Removing proxies and message queues. 2011-07-29 18:54:59 -07:00
Brian Anderson 4b356097c2 Change the locking rules around channel disassociation again
This prevents port's destructor from accessing a deleted channel
2011-07-28 14:25:20 -07:00
Eric Holk d79afd7916 Improving move semantics for channel operations.
This lets us un-XFAIL task-comm-10.rs.
2011-07-21 11:51:22 -07:00
Eric Holk 3ae4dcd41e Lots of work on memory tracking and channels.
We're trying to get closer to doing correct move semantics for channel
operations. This involves a lot of cleanup (such as removing the
unused sched parameter from rust_vec constructor) and making
circular_buffer kernel_owned.

Added tagging for memory allocations. This means we give a string tag
to everything we allocate. If we leak something and TRACK_ALLOCATIONS
is enabled, then it's much easier now to tell exactly what is leaking.
2011-07-21 11:51:22 -07:00
Graydon Hoare 39151f2ad8 Prohibit trailing whitespace under 'tidy' script. Clean up all caught cases. 2011-07-13 15:44:09 -07:00
Graydon Hoare 49116adbe9 Fix compile-command lines in rt. 2011-07-13 13:51:20 -07:00
Eric Holk 8acadb17c2 Work on debugging race conditions.
Ports and channels have been moved to the kernel pool, since they've
been known to outlive their associated task. This probably isn't the
right thing to do, the life cycle needs fixed instead.

Some refactorying in memory_region.cpp. Added a helper function to
increment and decrement the allocation counter. This makes it easier
to switch between atomic and non-atomic increments. Using atomic
increments for now, although this still does not fix the problem.
2011-07-07 18:22:27 -07:00
Eric Holk 49a8cb34d2 Removed dom_owned, splitting things between task_owned and kernel_owned. Had to re-xfail a few tests brson recently un-xfailed. 2011-06-28 16:12:33 -07:00
Marijn Haverbeke 880be6a940 Overhaul logging system in runtime
See https://github.com/graydon/rust/wiki/Logging-vision

The runtime logging categories are now treated in the same way as
modules in compiled code. Each domain now has a log_lvl that can be
used to restrict the logging from that domain (will be used to allow
logging to be restricted to a single domain).

Features dropped (can be brought back to life if there is interest):
  - Logger indentation
  - Multiple categories per log statement
  - I possibly broke some of the color code -- it confuses me
2011-04-19 16:57:13 +02:00
Marijn Haverbeke 9a7576fe2c Move to macro-based logging checks in the C++ code
No functions should be called for log statements that turn out to be
inactive.
2011-04-07 15:15:30 -07:00
Michael Bebenita de611a3090 Lots of design changes around proxies and message passing. Made it so that domains can only talk to other domains via handles, and with the help of the rust_kernel. 2010-09-07 18:44:12 -07:00
Michael Bebenita 7ff39ea448 Fixed deadlock by removing channel flushing. 2010-08-17 23:49:57 -07:00
Michael Bebenita 74e12fcef6 Ignore upcall_flush for channels that are disassociated from ports. This makes task-comm-10 break a little less hard, but it still leaks because messages pending in the channel are never freed. 2010-08-11 16:08:45 -07:00
Michael Bebenita 97d6342bf0 Synthesize a flush_chan upcall right before a channel's ref_count drops to zero. This should only happen in the Rust code and not in the drop glue, or on the unwind path. This change allows the task owning the channel to block on a flush and delete its own channel. This change also cleans up some code around rust_port and rust_chan. 2010-08-09 08:15:34 -07:00
Michael Bebenita 30734a9a7b Some pretty printing in the runtime. 2010-08-09 07:52:07 -07:00
Michael Bebenita 4246d567b7 Move ports out into their own file, add data_message and make communication system use it (and proxies) instead of existing token scheme. 2010-07-28 20:30:29 -07:00