@@ -1227,15 +1227,6 @@ immediately destructed (if acyclic) or else collected using a general
1227
1227
(cycle-aware) garbage-collector local to each task. Garbage collection within
1228
1228
a local heap does not interrupt execution of other tasks.
1229
1229
1230
- Immutable boxes are @dfn {shared }, and can be multiply-referenced by many
1231
- different tasks. Like any other immutable type, they can pass over channels,
1232
- and live as long as the last task referencing them within a given domain. When
1233
- unreferenced, they are destroyed immediately (due to reference-counting) and
1234
- returned to the heap memory allocator. Destruction of an immutable box also
1235
- executes within the context of the task that drops the last reference to a
1236
- shared heap allocation, so executing a long-running destructor does not
1237
- interrupt execution of other tasks.
1238
-
1239
1230
1240
1231
@node Ref.Mem.Own
1241
1232
@subsection Ref.Mem.Own
@@ -1371,25 +1362,23 @@ fn main() @{
1371
1362
@node Ref.Mem.Acct
1372
1363
@subsection Ref.Mem.Acct
1373
1364
@c * Ref.Mem.Acct:: Memory accounting model.
1374
- @cindex Domain
1375
1365
@cindex Accounting
1376
1366
@cindex Memory budget
1377
1367
1378
- Every task belongs to a domain, and that domain tracks the amount of memory
1379
- allocated and not yet released by tasks within it. @xref {Ref.Task.Dom }. Each
1380
- domain has a memory budget. The @dfn {budget } of a domain is the maximum amount
1381
- of memory that can be simultaneously allocated in the domain. If a task tries
1382
- to allocate memory within a domain with an exceeded budget, the task will
1383
- receive a signal.
1368
+ Every task tracks the amount of memory allocated and not yet released. Each
1369
+ task may have a memory budget. The @dfn {budget } of a task is the maximum
1370
+ amount of memory that can be simultaneously allocated in the task. If a task
1371
+ tries to allocate memory with an exceeded budget, the task will receive a
1372
+ signal.
1384
1373
1385
1374
Within a task, accounting is strictly enforced: all memory allocated through
1386
- the runtime library, both user data, sub-domains and runtime-support
1387
- structures such as channel and signal queues, are charged to a task's domain .
1375
+ the runtime library, both user data and runtime-support structures such as
1376
+ channel and signal queues, are charged to a task.
1388
1377
1389
- When a communication channel crosses from one domain to another, any value
1378
+ When a communication channel crosses from one task to another, any value
1390
1379
sent over the channel is guaranteed to have been @emph {detached } from the
1391
- domain 's memory graph (singly referenced, and/or deep-copied), so its memory
1392
- cost is transferred to the receiving domain .
1380
+ task 's memory graph (singly referenced, and/or deep-copied), so its memory
1381
+ cost is transferred to the receiving task .
1393
1382
1394
1383
1395
1384
@page
@@ -1414,7 +1403,6 @@ operating-system processes.
1414
1403
@menu
1415
1404
* Ref.Task.Comm :: Inter-task communication.
1416
1405
* Ref.Task.Life :: Task lifecycle and state transitions.
1417
- * Ref.Task.Dom :: Task domains.
1418
1406
* Ref.Task.Sched :: Task scheduling model.
1419
1407
* Ref.Task.Spawn :: Library interface for making new tasks.
1420
1408
* Ref.Task.Send :: Library interface for sending messages.
@@ -1467,12 +1455,12 @@ transmit side. A channel contains a message queue and asynchronously sending a
1467
1455
message merely inserts it into the sending channel's queue; message receipt is
1468
1456
the responsibility of the receiving task.
1469
1457
1470
- Queued messages in channels are charged to the domain of the @emph {sending }
1471
- task. If too many messages are queued for transmission from a single sending
1472
- task, without being received by a receiving task, the sending task may exceed
1473
- its memory budget, which causes a run-time signal. To help control this
1474
- possibility, a semi-synchronous send operation is possible, which blocks until
1475
- there is room in the existing queue before sending send.
1458
+ Queued messages in channels are charged to the @emph {sending } task. If too
1459
+ many messages are queued for transmission from a single sending task, without
1460
+ being received by a receiving task, the sending task may exceed its memory
1461
+ budget, which causes a run-time signal. To help control this possibility, a
1462
+ semi-synchronous send operation is possible, which blocks until there is room
1463
+ in the existing queue before sending send.
1476
1464
1477
1465
Messages are sent on channels and received on ports using standard library
1478
1466
functions.
@@ -1535,31 +1523,6 @@ A task in the @emph{dead} state cannot transition to other states; it exists
1535
1523
only to have its termination status inspected by other tasks, and/or to await
1536
1524
reclamation when the last reference to it drops.
1537
1525
1538
- @node Ref.Task.Dom
1539
- @subsection Ref.Task.Dom
1540
- @c * Ref.Task.Dom:: Task domains
1541
-
1542
- @cindex Domain
1543
- @cindex Process
1544
- @cindex Thread
1545
-
1546
- Every task belongs to a domain. A @dfn {domain } is a structure that owns tasks,
1547
- schedules tasks, tracks memory allocation within tasks and manages access to
1548
- runtime services on behalf of tasks.
1549
-
1550
- Typically each domain runs on a separate operating-system @emph {thread }, or
1551
- within an isolated operating-system @emph {process }. An easy way to think of a
1552
- domain is as an abstraction over either an operating-system thread @emph {or } a
1553
- process.
1554
-
1555
- The key feature of a domain is that it isolates memory references created by
1556
- the Rust tasks within it. No Rust task can refer directly to memory outside
1557
- its domain.
1558
-
1559
- Tasks can own sub-domains, which in turn own their own tasks. Every domain
1560
- owns one @emph {root task }, which is the root of the tree of tasks owned by the
1561
- domain.
1562
-
1563
1526
@node Ref.Task.Sched
1564
1527
@subsection Ref.Task.Sched
1565
1528
@c * Ref.Task.Sched:: Task scheduling model.
@@ -1568,11 +1531,9 @@ domain.
1568
1531
@cindex Preemption
1569
1532
@cindex Yielding control
1570
1533
1571
- Every task is @emph {scheduled } within its domain. @xref {Ref.Task.Dom }. The
1572
- currently scheduled task is given a finite @emph {time slice } in which to
1534
+ The currently scheduled task is given a finite @emph {time slice } in which to
1573
1535
execute, after which it is @emph {descheduled } at a loop-edge or similar
1574
- preemption point, and another task within the domain is scheduled,
1575
- pseudo-randomly.
1536
+ preemption point, and another task within is scheduled, pseudo-randomly.
1576
1537
1577
1538
An executing task can @code {yield } control at any time, which deschedules it
1578
1539
immediately. Entering any other non-executing state (blocked, dead) similarly
@@ -1591,7 +1552,7 @@ function. The passed function is referred to as the @dfn{entry function} for
1591
1552
the spawned task, and any captured environment is carries is moved from the
1592
1553
spawning task to the spawned task before the spawned task begins execution.
1593
1554
1594
- The result of a @code {spawn } call is a @code {std::task::task_id } value.
1555
+ The result of a @code {spawn } call is a @code {std::task::task } value.
1595
1556
1596
1557
An example of a @code {spawn } call:
1597
1558
@example
@@ -1606,10 +1567,10 @@ fn helper(c: chan<u8>) @{
1606
1567
1607
1568
let p: port<u8>;
1608
1569
1609
- spawn(bind helper(p.mk_chan( )));
1570
+ spawn(bind helper(chan(p )));
1610
1571
// let task run, do other things.
1611
1572
// ...
1612
- let result = p. recv();
1573
+ let result = recv(p );
1613
1574
1614
1575
@end example
1615
1576
@@ -1649,7 +1610,7 @@ An example of a @emph{receive}:
1649
1610
@example
1650
1611
import std::comm::*;
1651
1612
let p: port<str> = @dots {};
1652
- let s: str = p. recv();
1613
+ let s: str = recv(p );
1653
1614
@end example
1654
1615
1655
1616
@@ -3699,7 +3660,7 @@ signal queue associated with each task. Sending a signal to a task inserts the
3699
3660
signal into the task's signal queue and marks the task as having a pending
3700
3661
signal. At the next scheduling opportunity, the runtime processes signals in
3701
3662
the task's queue using its dispatch table. The signal queue memory is charged
3702
- to the task's domain ; if the queue grows too big, the task will fail.
3663
+ to the task; if the queue grows too big, the task will fail.
3703
3664
3704
3665
@c ############################################################
3705
3666
@c end main body of nodes
0 commit comments