Well maybe "thread-safety" is not the exact term to use - what I ment was  
an object, which will not break if accessed by multiple threads (not  
actually capable of doing >=2 things at once).

As for my scenario - it is relatively simple :
Most of the time - users do not need the database itself because a  
background class is doing synchronization between the main database, the  
local copy and the memory of the workstation. Two times a day, a user  
makes a report.
I have thought about making the report on a second connection, created and  
used on the GUI thread, but the information depends on the data in  
RAM/local storage, which may not be saved at the time of generating, which  
is why I mut-ex things in anyway.

Actually I just don`t like the idea of unnesesary connections(I have a  
thing about wasted resources) so I use just one, doing one thing at a time  
on different threads(gui or background). I find the idea useful and  
thought other people might like it :)

Thanks anyway, a second opinion usually saves me a few weeks of recode :D



Sat, 17 Apr 2010 21:38:07 +0400, Jiri Cincura <disk...@cincura.net>:

> On Sat, Apr 17, 2010 at 14:35, Ivan Arabadzhiev
> <intelru...@unrealsoft.net> wrote:
>> (and I hate mutexes) :). I guess I`ll get some sort of
>
> If you mean the Mutex class, then this class isn't the best choice in
> many scenarios. It's doing too much. But in general I don't believe in
> mut-ex at all. It's wasting resources blocking threads (or spinning).
>
>> wrapper for the provider to handle threads ... I`m tired of syncing them
>> 'the long way'
>
> I don't know your scenario... Why not to have one object per thread?
> Why not to have a worker thread (though creating thread explicitly
> hurt performance) doing the "database work" (which is what the mut-ex
> will end up actually doing) - this is inverting the problem.
>
> Maybe you're trying to do something, that's doable better way and
> somebody in list already tested the wrong paths, and will answer.
>


-- 
Sanity is a sin!

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to