You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>So I needed to learn golang.. I tought I’ll share my experiences.</p>
66
66
67
-
<p>Of course I made some assosations in my mind with C/C++/python. I know golang tutorials let you know that you should not make such assumptions.. but you will anyway.</p>
67
+
<p>Of course I made some assosations in my mind with C/C++/python. I know golang tutorials let you know that you should not make such assumptions.. but I could not help my self but to make them anyway.</p>
68
68
69
69
<p>So here is what I learned this far :</p>
70
70
@@ -136,6 +136,8 @@ <h1 id="-go-routines"><a href="#header-1"></a> go routines</h1>
136
136
137
137
<p>I think them as threads, fork etc.</p>
138
138
139
+
<p>Here main() waits for childs to exit and first foo() finnishes last.</p>
<p>For some really good reason there ++really is no++ official api/function to get the go routine id (thread id), so I just use some id for now. I did try to use uuid but those make log line too long.
163
-
Perhaps in future I’ll use the ‘context’ stuff they included quite resently.
164
+
<p>For some really good reason there ++really is no++ official api/function to get the go routine id (thread id).
165
+
So I just use some id for now. I did try to use uuid but those make log line too long.</p>
166
+
167
+
<p>Perhaps in future I’ll use the ‘context’ stuff they included quite resently.
164
168
I also heard that golang has inbuilt thread/go routine/function engine.. so you should be able to run more than real threads.. never needed that much yet.</p>
<p>So I needed to learn golang.. I tought I’ll share my experiences.</p>
66
66
67
-
<p>Of course I made some assosations in my mind with C/C++/python. I know golang tutorials let you know that you should not make such assumptions.. but you will anyway.</p>
67
+
<p>Of course I made some assosations in my mind with C/C++/python. I know golang tutorials let you know that you should not make such assumptions.. but I could not help my self but to make them anyway.</p>
68
68
69
69
<p>So here is what I learned this far :</p>
70
70
@@ -136,6 +136,8 @@ <h1 id="-go-routines"><a href="#header-1"></a> go routines</h1>
136
136
137
137
<p>I think them as threads, fork etc.</p>
138
138
139
+
<p>Here main() waits for childs to exit and first foo() finnishes last.</p>
<p>For some really good reason there ++really is no++ official api/function to get the go routine id (thread id), so I just use some id for now. I did try to use uuid but those make log line too long.
163
-
Perhaps in future I’ll use the ‘context’ stuff they included quite resently.
164
+
<p>For some really good reason there ++really is no++ official api/function to get the go routine id (thread id).
165
+
So I just use some id for now. I did try to use uuid but those make log line too long.</p>
166
+
167
+
<p>Perhaps in future I’ll use the ‘context’ stuff they included quite resently.
164
168
I also heard that golang has inbuilt thread/go routine/function engine.. so you should be able to run more than real threads.. never needed that much yet.</p>
0 commit comments