This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go build testsplice.go | |
$ echo "hello splice" | ./testsplice | |
$ splicing... buffer size: 4096 | |
recv: hello splice | |
count: 13 | |
finish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net" | |
"os" | |
"syscall" | |
"time" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For this problem, I tested two policies. | |
The first one is "small tasks first". Using this policy can make the scheduler achieve very high throughput in the terms of "# of tasks it can schedule in a given time". | |
But it will be likely to cause starvation problem. In which case if the small tasks keep coming, they will preempt the scheduler and block the big tasks. | |
So in real environment, this kind of scheduler will incent users not to lie about their actual usage. | |
The second one is "small tasks first + starvation proof" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
type obj struct { | |
a int | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package slice_vs_list | |
import ( | |
"container/list" | |
) | |
func runSliceAppend() { | |
s := make([]int, 0) | |
for i := 0; i < 1024; i++ { | |
s = append(s, i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yifan@yifan-laptop:~/c/playground$ cat testsequencepoint.c | |
#include <stdio.h> | |
int a[10]; | |
int i; | |
int main(int argc, char *argv[]) | |
{ | |
for (i = 0; i < 5;) { | |
a[i] = a[i++] + 5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp | |
index 85ca5c4..c197da9 100644 | |
--- a/src/tests/slave_tests.cpp | |
+++ b/src/tests/slave_tests.cpp | |
@@ -35,6 +35,7 @@ | |
#include <process/pid.hpp> | |
#include <process/subprocess.hpp> | |
+#include <stout/duration.hpp> | |
#include <stout/option.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Built-in gogoprotobuf over HTTP: | |
=== RUN TestGoGoProtobufHTTPMessenger | |
Generating 8192 messages | |
Sending 8192 messages from [0] to [0] | |
Done! time elasped: 440ms | |
Verifying 8192 messages | |
Messages look good! | |
Generating 8192 messages | |
Sending 8192 messages from [0] to [1] | |
Done! time elasped: 1935ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3rdparty/Makefile.am:71: warning: source file '$(GTEST)/src/gtest-all.cc' is in a subdirectory, | |
3rdparty/Makefile.am:71: but option 'subdir-objects' is disabled | |
automake: warning: possible forward-incompatibility. | |
automake: At least a source file is in a subdirectory, but the 'subdir-objects' | |
automake: automake option hasn't been enabled. For now, the corresponding output | |
automake: object file(s) will be placed in the top-level directory. However, | |
automake: this behaviour will change in future Automake versions: they will | |
automake: unconditionally cause object files to be placed in the same subdirectory | |
automake: of the corresponding sources. | |
automake: You are advised to start using 'subdir-objects' option throughout your |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mesos.pb.cc: In function ‘void mesos::protobuf_AssignDesc_mesos_2eproto()’: | |
mesos.pb.cc:293:97: error: ‘const class mesos::HealthCheck’ has no member named ‘consecutive_failures_’ | |
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HealthCheck, consecutive_failures_), | |
^ | |
mesos.pb.cc:425:95: error: ‘const class mesos::SlaveInfo’ has no member named ‘private_resources_’ | |
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SlaveInfo, private_resources_), | |
^ | |
mesos.pb.cc:591:104: error: ‘const class mesos::ResourceStatistics’ has no member named ‘net_rx_packets_’ | |
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResourceStatistics, net_rx_packets_), | |
^ |
OlderNewer