Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8407705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:26:23+00:00 2026-06-09T23:26:23+00:00

I have written a .dll that uses sqlite3. It has an insert function that

  • 0

I have written a .dll that uses sqlite3. It has an insert function that performs inserts on the database.

I also have a test executable that uses the dll to perform inserts. Right now I am testing sqlite and its ability to manage multiple connections. The test program inserts in an infinite loop, the pseudo code looks like this:

    while(1) {
      openDb();
      doInsert();
      closeDb();
     }

Basically I have set it up so that I run 4 versions of my test app, and each version inserts a letter (a, b, c or d) into the database.

Right now, this doesn’t work because the database is just about always locked. It works fine with one or two but it doesn’t if I run all 4 programs its like I create one big race condition.

I have looked at the documentation, and I have come accross things like SQLITE_OPEN_FULLMUTEX as specified here: http://www.sqlite.org/c3ref/open.html

Does sqlite3 provide a mechanism to deal with multiple exe’s trying to write to he same DB at once? Or am I simply pushing sqlite too hard in my load-testing? Do I need to write my own connection pool?

Any help on this matter would be great. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T23:26:25+00:00Added an answer on June 9, 2026 at 11:26 pm

    If you care what distribution you get, then you need to write code that won’t add a billion a’s without adding any b’s. You are writing code that doesn’t do what you want. That’s not sqlite’s fault. If you don’t want to write 1,000 a’s and no b’s, then don’t do that.

    All you are guaranteed is that the database will make forward progress. It’s up to your code not to ask the db to do things you absolutely don’t want it to do.

    Sqlite is making as much forward progress as it can as fast as it can. That’s its job and 99.99% of the time, that’s what everyone wants. Process switching is expensive, so sqlite is minimizing it. It’s your job not to ask it to do things you don’t want it to do. Write your code so that the db is only asked to do things you want it to do. Then when the db runs as fast as it possibly can, you’ll get what you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a test suite DLL written in C# that uses Selenium.This is then
I have an application written in PHP that uses a COM dll written in
I have a program written in VB.Net (Visual Studio 2008) that uses a DLL
I have written a C# console application that uses the Interop.domino.dll assembly to interact
I have a VB6 application that uses a COM DLL. The DLL is written
I have an application that is written in C# and uses a DLL written
I have written a DLL that uses MS Word to spell check the content
I have a DLL (written in C) that uses static thread local storage (
I have written a c# program that calls a c++ dll that echoes the
I have a DLL that is written in C++ and I want to suppress

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.