Sobes.tech

iOS

func getCarPrice() int64 { time.Sleep(1 * time.Second) return rand.Int63n(1000) } func main() { http.HandleFunc("/car/instant", func(resp http.ResponseWriter, req *http.Request) { fmt.Fprintf(resp, "%d", 0) }) http.ListenAndServe(":8080", nil) }

218

Perché alcune query restituiscono un prezzo che non è mai stato reale (ad esempio, un valore intermedio tra il vecchio e il nuovo prezzo)?

190

Perché aggiungere un mutex solo per la scrittura non risolve il problema della race condition? Come usare correttamente un mutex per proteggere una variabile condivisa?

168