Skip to content

Instantly share code, notes, and snippets.

@jeroiraz
jeroiraz / go-sqlite3_database_is_locked.go
Last active July 12, 2016 18:31 — 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"