想象一下直截了当的监督层级.孩子死了.父亲决定要Restart孩子.当Restart编辑时,postRestart和朋友们一起打电话,但如果父亲决定重新开始孩子怎么办?儿童演员是否知道他正在恢复?顺便说一下.父亲是否可以访问导致孩子出现异常的信息?
valgrind --tool = memcheck --leak-check = full --show-reachable = yes -v ./out
==37408== ERROR SUMMARY: 23 errors from 23 contexts (suppressed: 0 from 0)
==37408==
==37408== 1 errors in context 1 of 23:
==37408== Invalid read of size 1
==37408== at 0x707E: memmove$VARIANT$sse42 (in /usr/local/Cellar/valgrind/3.8.1/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==37408== by 0x10F08F: strdup (in /usr/lib/system/libsystem_c.dylib)
==37408== by 0x10000576A: new_node (parser.c:349)
==37408== by 0x100005E5D: string_literal (parser.c:166)
==37408== by 0x100001A5D: yyparse (vtl4.y:142)
==37408== by 0x1000029F1: main (vtl4.y:218)
==37408== Address 0x100055826 is 0 bytes after a block …Run Code Online (Sandbox Code Playgroud) 阅读Akka doc:http://doc.akka.io/docs/akka/2.2.3/AkkaScala.pdf其章节中的状态
2.2.1 Hierarchical Structure
The only prerequisite is to know that each actor has exactly one supervisor,
which is the actor that created it.
Run Code Online (Sandbox Code Playgroud)
但是在层次结构树的顶部,父级角色没有主管?
来自铁锈书:
在任何给定时间,您可以拥有一个可变引用或任意数量的不可变引用。
考虑以下代码:
fn main() {
let mut a = 41;
let b = &mut a;
let c: &i32 = &a; // [1]
let d: &i32 = &b;
println!("{} {}", b, c); // [2]
println!("{} {}", b, d);
}
Run Code Online (Sandbox Code Playgroud)
如果我们尝试编译我们会得到:
error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable
--> src\main.rs:43:19
|
42 | let b = &mut a;
| ------ mutable borrow occurs here
43 | let c: &i32 = &a; // [1] …Run Code Online (Sandbox Code Playgroud) 我正在用C++编写音乐生成器,我目前正在研究BPM.为了获得笔记之间等待的时间,我正在使用60 / bpm,但这个评估为零.我已经检查过以确保bpm声明了,而且确实如此.尝试60 / bpm出于某种原因给出了2.为什么是这样?