Skip to content

Instantly share code, notes, and snippets.

View lorenzodisidoro's full-sized avatar
:octocat:
Working everywhere

Lorenzo D'Isidoro lorenzodisidoro

:octocat:
Working everywhere
View GitHub Profile
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
@tiero
tiero / improved-lnd-bitcoind-mainnet.md
Created June 10, 2018 00:07 — forked from bretton/improved-lnd-bitcoind-mainnet.md
Detailed guide to installing LND and Bitcoind on Ubuntu 16.04 LTS for Mainnet

Intro

This guide is specific to getting LND 0.4.1-beta and Bitcoind running on Ubuntu 16.04 LTS for mainnet.

Original installation guide:

This guide is broken into the following sections:

  • Install bitcoind and set to start automatically
  • Install development tools and dependancies
@ryboe
ryboe / .travis.yml
Last active November 23, 2023 05:37
Example .travis.yml for Golang
# use the latest ubuntu environment (18.04) available on travis
dist: bionic
language: go
# You don't need to test on very old versions of the Go compiler. It's the user's
# responsibility to keep their compiler up to date.
go:
- 1.16.x
@learner-long-life
learner-long-life / Rinkeby.md
Last active August 30, 2022 22:32
How to get on Rinkeby Testnet in less than 10 minutes

How to get on Rinkeby Testnet in less than 10 minutes

Following instructions from the excellent https://www.rinkeby.io/

Synchronizing a Full Node

A full node lets you access all state. There is a light node (state-on-demand) and wallet-only (no state) instructions as well,

@tomconte
tomconte / web3-solc-contract-compile-deploy.js
Created December 13, 2016 09:32
Compiling and deploying an Ethereum Smart Contract, using solc and web3.
const fs = require('fs');
const solc = require('solc');
const Web3 = require('web3');
// Connect to local Ethereum node
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
// Compile the source code
const input = fs.readFileSync('Token.sol');
const output = solc.compile(input.toString(), 1);
@vsouza
vsouza / .bashrc
Last active June 14, 2024 08:45
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin