..@gmail.com>
> Subject: Re: [sqlite] Multi-threading Common Problem
> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>
> Date: Tuesday, May 24, 2011, 10:32 AM
> > I don't want per-say to remove
> my pthread_rwlock() but the main point
assume it is
>> returning SQLITE_BUSY). With my pthread_rwlock(), I have
>> multiple threads reading the DB and my writes get the
>> exclusive access they need. Now I could loop on the write
>> until it gets in but that seems very wasteful.
>> >
>> > So how
that. Pthread_rwlock() works fine.
Thanks,
John
--- On Tue, 5/24/11, Pavel Ivanov <paiva...@gmail.com> wrote:
> From: Pavel Ivanov <paiva...@gmail.com>
> Subject: Re: [sqlite] Multi-threading Common Problem
> To: "General Discussion of SQLite Database" <sqlite-users@s
the write until it gets in but that seems very
> wasteful.
>
> So how do I implement the equivalent of a pthread_rwlock() using SQLite
> mechinisms?
>
> Thanks,
>
> John
>
> --- On Tue, 5/24/11, Roger Binns <rog...@rogerbinns.com> wrote:
>
>> From: Roger Binns <
On 24 May 2011, at 12:43pm, John Deal wrote:
> Sorry to be so brain-dead but I am still confused. I have multiple threads,
> each with their own DB connection.
Read
http://www.sqlite.org/threadsafe.html
If it's not clear to you please ask specific questions about what's on that
page, since
nks,
John
--- On Tue, 5/24/11, Roger Binns <rog...@rogerbinns.com> wrote:
> From: Roger Binns <rog...@rogerbinns.com>
> Subject: Re: [sqlite] Multi-threading Common Problem
> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>
> Date: Tuesday, May
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 05/23/2011 09:12 PM, John Deal wrote:
> I guess I am lost on how to obtain a many reader or one writer mutex in
> SQLite.
You are confusing locks on the database and locks in the library on a
sqlite3 pointer. The latter is what the mutex alloc
s.
Thanks,
John
--- On Fri, 5/13/11, Roger Binns <rog...@rogerbinns.com> wrote:
> From: Roger Binns <rog...@rogerbinns.com>
> Subject: Re: [sqlite] Multi-threading Common Problem
> To: sqlite-users@sqlite.org
> Date: Friday, May 13, 2011, 2:00 AM
> -BEGIN PGP SIGNED
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 05/12/2011 01:26 PM, John Deal wrote:
> Good question. Very possible my understanding is not complete.
This document has the full details:
http://www.sqlite.org/lockingv3.html
>I have basically read and write transactions, each potentially
Hello Roger,
OK I see your point now. I could most likely remove the OS mutexes.
Thanks,
John
--- On Thu, 5/12/11, Roger Binns <rog...@rogerbinns.com> wrote:
> From: Roger Binns <rog...@rogerbinns.com>
> Subject: Re: [sqlite] Multi-threading Common Problem
> To: sq
Hello Pavel,
This makes sense but I have shared cache on.
Thanks.
--- On Thu, 5/12/11, Pavel Ivanov <paiva...@gmail.com> wrote:
> From: Pavel Ivanov <paiva...@gmail.com>
> Subject: Re: [sqlite] Multi-threading Common Problem
> To: "General Discussion of SQLi
is taking place.
>
> If a write transaction is not taking place, I want to allow multiple reads
> which the OS rwlock allows.
>
> Any enlightenment would be welcomed.
>
> Thanks.
>
> --- On Thu, 5/12/11, Roger Binns <rog...@rogerbinns.com> wrote:
>
>> F
> wrote:
> From: Roger Binns <rog...@rogerbinns.com>
> Subject: Re: [sqlite] Multi-threading Common Problem
> To: sqlite-users@sqlite.org
> Date: Thursday, May 12, 2011, 4:01 PM
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 05/12/2011 09:38 AM, John Dea
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 05/12/2011 09:38 AM, John Deal wrote:
> I have been working for weeks on this and I feel there must be something
> simple I am overlooking.
Why are you discarding SQLite's builtin and tested mutexes and then
effectively reimplementing your own
Hello All,
I have been using SQLite for a couple of years but have never posted to this
list before. I am sure my problem is common and am looking for ideas to solve
it.
I have used SQLite extensively single-threaded with no problems (other than my
own!). I am currently working on another
Hello!
I use the latest (3.6.11) version of the SQLite dll in a WinXP
Application.
The main task of this application is to store values from a
sensor-hardware in multiple databases. Each DB contains a subset from the
Values.
I tested serveral design options. One is to read all values from the
Create a connection for each thread.
--- On Wed, 1/28/09, Anatoly Stepanov <anatoly.stepa...@kaspersky.com> wrote:
> From: Anatoly Stepanov <anatoly.stepa...@kaspersky.com>
> Subject: [sqlite] Multi-threading problem!
> To: "sqlite-users@sqlite.org" <sqlite-u
Hello!
I use the latest (3.6.10) version of SQLite library.
I was trying to perform query "select" from one table inside single database
connection from different threads(up to 8 threads).
In summary I had 50% CPU Usage( 2 core CPU)-this is a problem! I tried to find
the reason in Debug mode and
Just FYI...
All you people posting to comp.sys.15yearoldarguments - you know you're
also cross-posting to the sqlite mailing list, right?
Tim
Mrs. Brisby wrote:
On Sat, 2005-07-30 at 20:29 +0200, Jan-Eric Duden wrote:
Mrs. Brisby wrote:
On Sat, 2005-07-30 at 14:30 +0200, Jan-Eric Duden
On Sat, 2005-07-30 at 20:29 +0200, Jan-Eric Duden wrote:
> Mrs. Brisby wrote:
>
> >On Sat, 2005-07-30 at 14:30 +0200, Jan-Eric Duden wrote:
> >
> >
> >>Win9X doesn't support the API async file operations.
> >>WinNT/2K/XP does support it.
> >>
> >>
> >
> >It supports everything it needs to:
Mrs. Brisby wrote:
On Sat, 2005-07-30 at 14:30 +0200, Jan-Eric Duden wrote:
Win9X doesn't support the API async file operations.
WinNT/2K/XP does support it.
It supports everything it needs to:
On Sat, 2005-07-30 at 14:30 +0200, Jan-Eric Duden wrote:
> Win9X doesn't support the API async file operations.
> WinNT/2K/XP does support it.
It supports everything it needs to:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/waitformultipleobjects.asp
it doesn't
On Fri, 2005-07-29 at 14:29 -0700, Robert Simpson wrote:
> Threads are a tool ... sortof like a chainsaw. Used properly, they can save
> you time and accomplish your goal. In the hands of an expert, you can even
> make some impressive art. Well, perhaps the latter only applies to
>
On Fri, 2005-07-29 at 16:22 -0600, K. Haley wrote:
> Mrs. Brisby wrote:
>
> >Now, if you're feeling like you're on a high horse, go ahead: point out
> >a single common platform where threads are the necessity.
> >
> >Here's some hints:
> >
> >* it's not windows
> >* it's not unix
> >* it's not
Reminds me alt.C in the News Groups, arguing over curly bracket
placement :-(
-Original Message-
From: Puneet Kishor [mailto:[EMAIL PROTECTED]
Sent: Friday, July 29, 2005 5:23 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Multi-threading.
Fred Williams wrote:
> How 'bout Y'
Mrs. Brisby wrote:
Now, if you're feeling like you're on a high horse, go ahead: point out
a single common platform where threads are the necessity.
Here's some hints:
* it's not windows
* it's not unix
* it's not java (closures)
* it's not lisp (closures)
* it's not forth (coroutines)
* it's
Some class-libraries make multithreading programming really easy, piece
of cake, even when there are points to synchronize again to a single
thread (f.e. interface), it is easy. You do not need to be a genius to
write multithreading/multithreaded code
kind regards
Bert Verhees
Like it or not, you still don't have any idea what you are doing. They
[threads] are never the only solution, and they are rarely appropriate.
I'm certain I'm not being entirely clear on just how rare it is: Threads
so rarely help that the programs that they CAN help don't often use
them, and
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Multi-threading.
On Thu, 2005-07-28 at 07:42 -0500, Dennis Jenkins wrote:
> Mrs. Brisby wrote:
>
> >meanwhile, two threads attempting to multiplex access to a single
sqlite
> >handle are a) bound to be confused, and b) need th
On Thu, 2005-07-28 at 07:42 -0500, Dennis Jenkins wrote:
> Mrs. Brisby wrote:
>
> >meanwhile, two threads attempting to multiplex access to a single sqlite
> >handle are a) bound to be confused, and b) need those resource locks
> >anyway.
> >
> >
> >
> (background: I've been using threads on
On Thu, 2005-07-28 at 08:44 -0400, Eli Burke wrote:
> Mrs. Brisby wrote:
> > My PII-350 easily handles 2 million local deliveries per hour, and it
> > fork()s for each one.
> >
> > As has been mentioned: If you think threads are going to make your
> > program fast, you don't know what you're
Mrs. Brisby wrote:
> My PII-350 easily handles 2 million local deliveries per hour, and it
> fork()s for each one.
>
> As has been mentioned: If you think threads are going to make your
> program fast, you don't know what you're doing.
Like it or not, the world is bigger than just Unix. Some of
Mrs. Brisby wrote:
meanwhile, two threads attempting to multiplex access to a single sqlite
handle are a) bound to be confused, and b) need those resource locks
anyway.
(background: I've been using threads on win32 since 1998. Sometimes to
spread load across multiple CPUs, but usually
On Wed, 2005-07-27 at 13:31 -0400, Andrew Piskorski wrote:
> On Tue, Jul 26, 2005 at 10:21:22PM -0400, Mrs. Brisby wrote:
>
> > That's incorrect. Threading increases development time and produces less
> > stable applications. In fairness: it's the skill level of the engineer
...
> When people -
On Wed, 2005-07-27 at 09:08 +0100, Paul Smith wrote:
> At 03:21 27/07/2005, Mrs. Brisby wrote:
> >On Mon, 2005-07-25 at 09:48 -0500, Jay Sprenkle wrote:
> > > The theory has been proposed that threads aren't better than separate
> > > processes, or application implemented context switching. Does
On Tue, 2005-07-26 at 23:20 -0400, Kervin L. Pierre wrote:
> We get all those threads related questions because SQLite
> is difficult to use with threads and has sparse sometimes
> conflicting documentation on the subject.
Maybe people think that SQLite should serialize its own internals. Maybe
On Tue, Jul 26, 2005 at 10:21:22PM -0400, Mrs. Brisby wrote:
> That's incorrect. Threading increases development time and produces less
> stable applications. In fairness: it's the skill level of the engineer
Mrs. Brisby, that is probably quite correct in at least one particular
sense, but since
On Wed, 27 Jul 2005, Paul Smith wrote:
>At 03:21 27/07/2005, Mrs. Brisby wrote:
>>On Mon, 2005-07-25 at 09:48 -0500, Jay Sprenkle wrote:
>> > The theory has been proposed that threads aren't better than separate
>> > processes, or application implemented context switching. Does anyone
>> > have
At 03:21 27/07/2005, Mrs. Brisby wrote:
On Mon, 2005-07-25 at 09:48 -0500, Jay Sprenkle wrote:
> The theory has been proposed that threads aren't better than separate
> processes, or application implemented context switching. Does anyone
> have an experiment that will prove the point either way?
Mrs. Brisby wrote:
chances are you can't use threads correctly either. This mailing list is
an excellent example of how many "professional programmers" simply can't
deal with threads- every problem they run into, it's "how do I make
sqlite work with threads".
If you have to ask that question,
On Mon, 2005-07-25 at 09:00 +0100, Ben Clewett wrote:
> I like what you say about computer science being a Science. This is
> exactly my point. A science is a collection of theories which hold true
> within a domain until otherwise dissproven. For instance Isac Newtons's
> law of gravety and
On Mon, 2005-07-25 at 09:48 -0500, Jay Sprenkle wrote:
> The theory has been proposed that threads aren't better than separate
> processes, or application implemented context switching. Does anyone
> have an experiment that will prove the point either way? It will have
> to be OS specific though,
> Computer _Science_ is just that: Science. It's not opinion.
What they taught me at university was the current collection of "best
practices" for solving problems. "Here's a common problem, here are
the known good algorithms for solving it. Here are the techniques we
use for creating 'good'
rd over 20 years ago.
:)
Ben.
Steve
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
rg]On Behalf Of Ben Clewett
Sent: 25 July 2005 09:01
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Multi-threading.
Dear Mrs Brisby,
Thanks for your passionate replies to m
ve all got
their origins in concepts put forward over 20 years ago.
Steve
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
rg]On Behalf Of Ben Clewett
Sent: 25 July 2005 09:01
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Multi-threading.
Dear Mrs Brisby,
Thank
Dear Mrs Brisby,
Thanks for your passionate replies to my original posting. You have
much information here. It's obvious I don't know everything about
threading.
I like what you say about computer science being a Science. This is
exactly my point. A science is a collection of theories
On Fri, 2005-07-22 at 17:23 -0400, D. Richard Hipp wrote:
> On Fri, 2005-07-22 at 14:00 -0700, Tim McDaniel wrote:
> > It is hard, if not impossible, with modern GUI
> > systems to write any relatively complex app that is both performant and
> > graphically responsive without using threads.
> >
>
On Fri, 2005-07-22 at 14:00 -0700, Tim McDaniel wrote:
> > History has demonstrated that programmers building
> > multithreaded applications tend to produce buggier code, and
> > code that touches more pages than a non-threaded version. As
> > a result, the non-threaded version is easier to
On Fri, 2005-07-22 at 14:00 -0700, Tim McDaniel wrote:
> It is hard, if not impossible, with modern GUI
> systems to write any relatively complex app that is both performant and
> graphically responsive without using threads.
>
Not true.
The event model works just fine for GUI programming.
The
> -Original Message-
> From: Mrs. Brisby [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 22, 2005 3:07 PM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Multi-threading.
>
> > However the need for multi-threads is compelling.
> Especially in a GUI
>
On 7/22/05, Paul G <[EMAIL PROTECTED]> wrote:
> > Using Exceptions correctly, I have never felt the need for a GoTo.
> > Exceptions do the same as GoTo, accept, maybe, in a slightly more
> > developed and useful way.
>
> then you haven't coded anything complex enough to require them. i can tell
- Original Message -
From: "Ben Clewett" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Wednesday, July 20, 2005 12:26 PM
Subject: Re: [sqlite] Multi-threading.
> Dr Hipp,
>
> I am just playing devils advocate here because I have completed muc
On Wed, 2005-07-20 at 17:26 +0100, Ben Clewett wrote:
> Dr Hipp,
>
> I am just playing devils advocate here because I have completed much
> Java programming in a multi-threaded application. :)
>
> I understand the problems of multi-threading. I am reminded that it
> took nearly 20 years of
Dr Hipp,
I am just playing devils advocate here because I have completed much
Java programming in a multi-threaded application. :)
I understand the problems of multi-threading. I am reminded that it
took nearly 20 years of development to get multi-processor support in a
modern OS stable. Much
Paul G wrote:
richard's advice is solid. use async io/event loops if possible, separate
processes if possible, threads as a last resort, in that order. the grey
area is the 'if possible' test, since it's a multi-way tradeoff between
performance, simplicity and provable (to an extent)
On Fri, Jul 15, 2005 at 01:04:50PM -0400, Paul G wrote:
> the issue wasn't necessarily the thread implementation per se, but the fact
> that threads were treated as processes for scheduling purposes and hence
> scheduled with the regular process scheduler, which was not efficient for a
> large
D. Richard Hipp wrote:
On Fri, 2005-07-15 at 16:41 +0530, Roushan Ali wrote:
Hello all,
Can we use single sqlite_open handle(global) across threads(
if all database operations are serialized by using semaphore) ? Please
help.
Opening a database connection in one thread
Andrew Piskorski wrote:
On Fri, Jul 15, 2005 at 04:21:05PM +0300, Cariotoglou Mike wrote:
memory and cpu-wise. on Linux, this is nothing, it can handle it easily.
otoh, 500 threads for windows is business as usual, but threading on
Linux, is , I hear, iffy at best.
Linux runs
- Original Message -
From: "Andrew Piskorski" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Friday, July 15, 2005 1:05 PM
Subject: Re: [sqlite] Multi-threading.
> On Fri, Jul 15, 2005 at 04:21:05PM +0300, Cariotoglou Mike wrote:
>
>
D. Richard Hipp wrote:
Actually, this seems like a good opportunity to repeat my
oft-ignored advice to not use more than one thread in a single
address space. If you need multiple threads, create multiple
processes.
I think its not really an acceptable option for those who are on Windows
Roushan Ali wrote:
Hi,
Thanks for your response. I don't have any idea how multiple
connection objects work. Can you please tell us something about that.
I wrappered the C interface to SQLite3 via a C++ Class called
"CSqlite3". The constructor does NOT open the database, it just
Hi,
Thanks for your response. I don't have any idea how multiple
connection objects work. Can you please tell us something about that.
Thanks,
Roushan
On Fri, 2005-07-15 at 20:15, Dennis Jenkins wrote:
> Roushan Ali wrote:
>
> >Thanks Richard for your reply.
> >
> >Actually, we have written
On Fri, Jul 15, 2005 at 08:27:14AM -0400, D. Richard Hipp wrote:
> [...]
> I am constantly amazed at the prevailing idea (exemplified
> by Java) that software should be strongly typed and should
> not use goto statement or pointers - all in the name of
> reducing bugs - but that it is OK to use
Roushan Ali wrote:
Thanks Richard for your reply.
Actually, we have written a windows application which uses four threads.
Each thread may have to add/delete thousands of entries in the database(
for performance reason , we don't want to open/close the database for
each insertion/deletion)
Thanks Richard for your reply.
Actually, we have written a windows application which uses four threads.
Each thread may have to add/delete thousands of entries in the database(
for performance reason , we don't want to open/close the database for
each insertion/deletion) .If we use different
applicable.
> -Original Message-
> From: D. Richard Hipp [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 15, 2005 3:27 PM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Multi-threading.
>
> On Fri, 2005-07-15 at 16:41 +0530, Roushan Ali wrote:
> > Hello al
On Fri, 2005-07-15 at 16:41 +0530, Roushan Ali wrote:
> Hello all,
> Can we use single sqlite_open handle(global) across threads(
> if all database operations are serialized by using semaphore) ? Please
> help.
>
Opening a database connection in one thread and using it in
Hello all,
Can we use single sqlite_open handle(global) across threads(
if all database operations are serialized by using semaphore) ? Please
help.
Regards,
Roushan
Jay Sprenkle wrote:
I also note the performance gains which can be obtained from modern
hyperthreaded CPU's.
Does Linux/Windows make each process a thread on these beasties?
If so, wouldn't making each task a process end up being the same thing?
Each process is a collection of one or more
> I also note the performance gains which can be obtained from modern
> hyperthreaded CPU's.
Does Linux/Windows make each process a thread on these beasties?
If so, wouldn't making each task a process end up being the same thing?
Jay Sprenkle wrote:
My advice to *all* programmers is to never use more than one thread
in the same address space. I have never in 20 years worked on a
multiple threaded program that actually got all of the threading
issues right. There are always subtle bugs that cause error that
are very
> My advice to *all* programmers is to never use more than one thread
> in the same address space. I have never in 20 years worked on a
> multiple threaded program that actually got all of the threading
> issues right. There are always subtle bugs that cause error that
> are very difficult to
: <sqlite-users@sqlite.org>
Sent: Sunday, April 17, 2005 11:20 PM
Subject: Re: [sqlite] multi threading
SELECT id, code FROM a WHERE
(code IN
(SELECT code FROM
(SELECT code, COUNT(code) AS c FROM a GROUP BY code) AS
aaa
WHERE c > 1)
)
and O
> SELECT id, code FROM a WHERE
> (code IN
> (SELECT code FROM
> (SELECT code, COUNT(code) AS c FROM a GROUP BY code) AS aaa
> WHERE c > 1)
> )
>and ORDER BY code
The "and" in your code is illegal, but it is better to use
select id, code from a
users@sqlite.org>
Sent: Saturday, April 16, 2005 2:11 AM
Subject: Re: [sqlite] multi threading
On Fri, 2005-04-15 at 14:44 +0300, Cosmin Vlasiu wrote:
Hello to everyone,
I have a question... regarding multi-threading...
the question is for microsoft windows (a visual c++ application)... I sa
On Fri, 2005-04-15 at 14:44 +0300, Cosmin Vlasiu wrote:
> Hello to everyone,
>
> I have a question... regarding multi-threading...
> the question is for microsoft windows (a visual c++ application)... I saw
> the documentation
> and I understood that for microsoft OS, the multi-threading is
Hello to everyone,
I have a question... regarding multi-threading...
the question is for microsoft windows (a visual c++ application)... I saw
the documentation
and I understood that for microsoft OS, the multi-threading is
enabled by default.
So, of course I start two threads, both of them
77 matches
Mail list logo