File tree Expand file tree Collapse file tree 5 files changed +14
-12
lines changed Expand file tree Collapse file tree 5 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 4641fcef616a7ee1eece4f00f757958757deb438
2
+ refs/heads/master: 5917ca35190b526b65b4d26ad0b98024ce9e0b09
Original file line number Diff line number Diff line change @@ -262,8 +262,6 @@ void rust_dom::send_message(rust_message *message) {
262
262
this );
263
263
A (this , message->dom == this , " Message owned by non-local domain." );
264
264
_incoming_message_queue.enqueue (message);
265
- _incoming_message_pending.signal ();
266
- _progress.signal ();
267
265
}
268
266
269
267
/* *
@@ -398,9 +396,11 @@ rust_dom::start_main_loop()
398
396
" all tasks are blocked, waiting for progress ..." );
399
397
if (_log.is_tracing (rust_log::TASK))
400
398
log_state ();
401
- _progress.wait ();
402
399
log (rust_log::TASK,
403
- " progress made, resuming ..." );
400
+ " all tasks are blocked, scheduler yielding ..." );
401
+ sync::yield ();
402
+ log (rust_log::TASK,
403
+ " scheduler resuming ..." );
404
404
continue ;
405
405
}
406
406
@@ -450,7 +450,14 @@ rust_dom::start_main_loop()
450
450
}
451
451
452
452
if (_incoming_message_queue.is_empty ()) {
453
- _incoming_message_pending.wait ();
453
+ log (rust_log::DOM,
454
+ " waiting for %d dead tasks to become dereferenced, "
455
+ " scheduler yielding ..." ,
456
+ dead_tasks.length ());
457
+ if (_log.is_tracing (rust_log::TASK)) {
458
+ log_state ();
459
+ }
460
+ sync::yield ();
454
461
} else {
455
462
drain_incoming_message_queue ();
456
463
}
Original file line number Diff line number Diff line change @@ -34,13 +34,10 @@ struct rust_dom
34
34
rust_task *curr_task;
35
35
int rval;
36
36
37
- condition_variable _progress;
38
-
39
37
hash_map<rust_task *, rust_proxy<rust_task> *> _task_proxies;
40
38
hash_map<rust_port *, rust_proxy<rust_port> *> _port_proxies;
41
39
42
40
// Incoming messages from other domains.
43
- condition_variable _incoming_message_pending;
44
41
lock_free_queue _incoming_message_queue;
45
42
46
43
#ifndef __WIN32__
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ extern "C" {
38
38
#error "Platform not supported."
39
39
#endif
40
40
41
+ #include " sync/sync.h"
41
42
#include " sync/condition_variable.h"
42
43
43
44
#ifndef __i386__
Original file line number Diff line number Diff line change @@ -556,9 +556,6 @@ rust_task::wakeup(rust_cond *from)
556
556
A (dom, cond == from, " Cannot wake up blocked task on wrong condition." );
557
557
558
558
transition (&dom->blocked_tasks , &dom->running_tasks );
559
- // TODO: Signaling every time the task is awaken is kind of silly,
560
- // do this a nicer way.
561
- dom->_progress .signal ();
562
559
I (dom, cond == from);
563
560
cond = NULL ;
564
561
}
You can’t perform that action at this time.
0 commit comments