Skip to content

Instantly share code, notes, and snippets.

thread goroutine
OS threads are managed by kernal and has hardware dependencies. goroutines are managed by go runtime and has no hardware dependencies.
OS threads generally have fixed stack size of 1-2MB goroutines typically have 8KB (2KB since Go 1.4) of stack size in newer versions of go
Stack size is determined during compile time and can not grow Stack size of go is managed in run-time and can grow up to 1GB which is possible by allocating and freeing heap storage
There is no easy communication medium between threads. There is huge latency between inter-thread communication. goroutine use channels to communicate with other goroutines with low latency (read more).
Threads have identity. There is TID which identifies each thread in a process. goroutine do not have any identity. go implemented this because go does not have TLS([Thread Local Storage](https://msdn.microsoft.com/en-us/library/win
@sloanlance
sloanlance / jq_jsonl_conversion.md
Last active June 18, 2024 15:27
jq: JSONL ↔︎ JSON conversion

jq: JSONL ↔︎ JSON conversion

Prerequisites

  • jqhttps://jqlang.github.io/jq/ — "like sed for JSON data"

    There are several options available for installing jq. I prefer to use Homebrew: brew install jq

  1. JSONL → JSON