Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

threads

3 views
Skip to first unread message

Charles Albrecht

unread,
Nov 28, 2002, 2:01:22 AM11/28/02
to

is there a demo of Btree filer using threads ( is it thread safe )?
--
Thanks,
Charles Albrecht
http://207.136.234.16:2080


Rob Roberts [TPX]

unread,
Nov 28, 2002, 11:46:41 AM11/28/02
to
Charles,

> is there a demo of Btree filer using threads ( is it thread safe )?

No, B-Tree Filer is not thread-safe. If you want to use it in a
multi-threaded app, you must use critical sections to ensure that Filer
calls aren't interrupted by other threads. There are other issues you might
also have to deal with, depending on what your app is doing. For example,
if more than one thread is using BTNextKey to process a file sequentially,
you will have to reposition the file pointer each time the thread gets its
turn.

If you are starting fresh, B-Tree Filer is definitely not a good choice for
a multi-threaded app (including ISAPI DLLs). But if you have a legacy
B-Tree Filer database that you need to allow web access to via an ISAPI DLL,
it can be done and it can work quite well, with good performance. But you
have to be VERY careful in dealing with the threading issues. I've written
this type of ISAPI DLL for clients, and I ran into some problems until I
added debugging code to verify that every Filer call takes place within a
critical section. This allowed me to find a few places that I had missed.

--Rob [TPX]


Charles Albrecht

unread,
Dec 6, 2002, 12:43:09 PM12/6/02
to
Many Thanks ( that brings up many more questions )...

"Rob Roberts [TPX]" <do...@email.me> wrote in message
news:AgOgS3vl...@tpsmail01.turbopower.net...

Rob Roberts [TPX]

unread,
Dec 6, 2002, 12:43:39 PM12/6/02
to
Charles,

> Many Thanks

You're welcome.

> ( that brings up many more questions )...

Feel free to ask them...

--Rob [TPX]


Richard Light

unread,
Dec 13, 2002, 3:55:35 AM12/13/02
to
In message <AgOgS3vl...@tpsmail01.turbopower.net>, "Rob Roberts
[TPX]" <do...@email.me> writes

>If you are starting fresh, B-Tree Filer is definitely not a good choice for
>a multi-threaded app (including ISAPI DLLs). But if you have a legacy
>B-Tree Filer database that you need to allow web access to via an ISAPI DLL,
>it can be done and it can work quite well, with good performance. But you
>have to be VERY careful in dealing with the threading issues. I've written
>this type of ISAPI DLL for clients, and I ran into some problems until I
>added debugging code to verify that every Filer call takes place within a
>critical section. This allowed me to find a few places that I had missed.

I've produced a DLL of this kind, and after hitting some problems with
it (which your comments might well help to resolve) I switched to a CGI
executable. At first sight this performs much better under load, but it
still gives errors when there is enough load to put the machine at 100%
CPU usage.

Are there issues with a large number of concurrent processes opening the
same (shared, read-only) B-Tree database? Am I right in thinking that
having each request in a separate CGI process will have finessed the
multi-threading issue?

Richard Light

--
Richard Light
SGML/XML and Museum Information Consultancy
ric...@light.demon.co.uk

0 new messages