Skip to content

Instantly share code, notes, and snippets.

View gwenn's full-sized avatar
💭
I may be slow to respond.

gwenn gwenn

💭
I may be slow to respond.
View GitHub Profile
@gwenn
gwenn / go-sqlite3_database_is_locked.go
Last active July 19, 2019 12:46 — forked from mrnugget/go-sqlite3_database_is_locked.go
Program that tests the concurrency issues with go-sqlite3. This will create two tables: `products` and `users`. One goroutine will repeatedly read from the `products` table in N fresh goroutines. At the same time ONE goroutine writes to the other table.
package main
import (
"database/sql"
"fmt"
"log"
"math/rand"
"sync"
"time"