|
dfsdfsd;)
|
|
|
|
|
Is there any documentation on the thread safety of the Dinkumware STL library distributed with VS.NET 2003?
-Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Dinkumware's STL is thread-safe in a very weak manner: if thread A uses container instance a and thread B uses a different container instance b , no threading problems arise. But if the same container instance is simultaneously handled by two different threads, no guarantee is made at all: you will have to synchronize access to the container by your own.
There are good reasons for not providing stronger thread-safety: the rationale is that oftenly most of the time the program has its own concepts about what an atomic operation is, and this may involve more than one call to STL; for instance in an accounting program an atomic transaction operation involves removing an element from somewhere and inserting it somewhere else. In these situations, simple thread-safety at the call invocation level does not suffice.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
SGI docs say that read access to same container from multiple threads is safe. But, from what you mention, I assume that even that is not guaranteed by Dinkumware.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I doubt that is the case. There can never be thread errors on read only operations. I have a really hard time to believe that dinkumware STL is doing write operations behind the scenes of a perceived read only operation. Then someone ought to take the dinkumware STL authors out on a field and... But I really really really doubt anyone would do such a treacherous thing.
--
Gott weiß ich will kein Engel sein.
|
|
|
|
|
I started getting a very sporadic and strange error on a STL find operation on a vector, and found that the only change from a previous version was that the container is now accessed from two threads. The vector is not written to after startup. Hence the question. I went to the Dinkumware site, and they make no statement on any thread safety.
According to one mail I read on a mailing list, there indeed was some problem with the VC6 version of STL regarding multiple readers, but Dinkumware has released a new version after that and is included in VS.NET 2003.
I was hoping someone might have a conclusive answer, just for the sake of knowing. This is certainly not a problem for my current situation. I already added thread-symc code to prevent simultaneous access to the vector.
Jörgen Sigvardsson wrote:
someone ought to take the dinkumware STL authors out on a field and...
I have a few ideas to fill in the blanks.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Old Dinkumware's STL as shipped with VC6 certainly had an issue with thread-safety even in the weak sense described above. From what I undertand, this is fixed in the STL shipping with MSVC 7.1.
Have you checked whether the fixes described in http://www.dinkumware.com/vc_fixes.html[^] are already incorporated in the STL you are using? If so, and if you still have the problem, I suggest you post it to microsoft.public.vc.stl adding "Dinkumware" in the subject line: P. J. Plauger or Pete Becker from Dinkumware will surely show up promptly
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquín M López Muñoz wrote:
Dinkumware's STL is thread-safe in a very weak manner: if thread A uses container instance a and thread B uses a different container instance b, no threading problems arise.
The version shipped with VC6 wasn't even thread-safe in this regard. I learned it the hard way
|
|
|
|
|
I have some problem in writing An ATL COM Simple Server. When i try to make a new project i notice that some files where the main code must be are not created.
For example i write a project with name FirstCom, and i don't have FirstCom.h, and in FirstCom.cpp i have only this:
#include "stdafx.h"
#include "resource.h"
[ module(dll, uuid = "{85212E22-36B1-470E-A30A-CBC2B398C31B}",
name = "FirstCom",
helpstring = "FirstCom 1.0 Type Library",
resource_name = "IDR_FIRSTCOM") ]
<\pre>
And that's why i think i have error, that my servers isn't registred(smth like this:)). I have
Visual Studio Net 2002 and WTL installed. Can it be the problem??? How to uninstall in that case WTL??? Or What To Do???
Thanks.
|
|
|
|
|
Does anybody know what development tools I could use for the Windows CE platform to make use of a ATL DLL that I wrote with Embedded Visual C++ 4.0?
I cannot add it as a reference to any of the tools that I have including Visual Basic and C# from Studio .NET 2003 and Embedded Visual Basic 3.0.
Thanks in advance.
Max
|
|
|
|
|
I want to use Icon overlay for my files.
What i ve to do with the folowing method of IShellIconOverlayIdentifier
Methods are
GetOverlayInfo
GetPriority
IsMemberOf
(let my file type is .myp)
|
|
|
|
|
Hi there,
I'm trying to mimic Acrobat Reader (or MS Office) behavior: that is when a pdf document is embedded in some HTML, the Acrobat Reader displays itself in IE. If accessed thru Windows Explorer, the Acrobat Reader app is started.
I want to mimic the same behavior for a new file type that i will call .xyz
When a file of type .xyz is accessed thru Windows Explorer, a viewer is launched and this is fine. Now when a .xyz file is clicked in IE, it also launches the associated viewer, but outside IE. This is not what i want.
Any suggestions on how to proceed? Can a BHO do the trick? What are the mechanics behind the scene on how Acrobat Reader is working?
Any comments or hints would be highly appreciated. Thanks.
Thanks,
pnyr
|
|
|
|
|
|
Thanks for the reply.
I came to the same conclusion, but then i renamed the 2 BHO DLLs associated with Acrobat Reader and pdfs are still opening inside the browser, so i am not sure.
pnyr.
|
|
|
|
|
Hello everyone
Could you teach me whether the image and text can be putted into the same listview?
Thank you.
-Freehawk
|
|
|
|
|
Check out CodeProject code section for examples.
Kuphryn
|
|
|
|
|
Thank you for the reply.
Could you tell some details?
-Freehawk
|
|
|
|
|
Hello everyone
In a wtl7.1 project I want to make a view in which there will be three columns, one column will be used to display line number, the second column will be used to display some icon or image, the thirth column will be used to display some colorful strings. Could you give me some advices?
Thank you.
-Freehawk
|
|
|
|
|
I have a need to create a large one-dimensional array and perform calculations (such as sum, max etc) on various sectins of the array.
From what I can understand about valarray, it seems to offer exactly these features. However, I am more than a little confused as to the "slice" part of this. For example, what is a "stride" and why do I need it?
Surely, to get access to a slice of the array, I only need a start position and an end point?
Like most of the STL, this is so badly documented and what examples[^] exist assume that I know what a slice is, and why I need one. Not only that, but the slices seem to be constructed out of completely arbitrary numbers! I am very close to simply using a vector and calculating everything myself...
Can anyone point me to a *good* and *simple* example on how to use valarray and slice on a one-dimensional array, or maybe explain things a little better?
Thanks!
|
|
|
|
|
I think that you'll find that strides are more applicable to multi-dimensional arrays - for a contiguous slice of a 1-D array, the stride will be 1.
I would suggest that if you want 1-D arrays only and you're manipulating contiguous sub-sets of the array, then use vector. valarray has been generally recognised as not the best solution for the problem it was designed to solve (see this[^] and this[^]).
<edit>
And here's an example of valarray :
#include <valarray>
#include <iostream>
#include <iterator>
int main(int, char**)
{
std::valarray<int> v(10);
for(int i=0;i<v.size();++i)
v[i] = i;
std::valarray<int> v2(10);
for(i=0;i<v2.size();++i)
v2[i] = 200;
for(i=0;i<v.size();++i)
std::cout << ((i==0)?"":", ") << v[i];
std::cout << "\n";
std::slice_array<int> s = v[std::slice(1, 3, 2)];
s += v2;
for(i=0;i<v.size();++i)
std::cout << ((i==0)?"":", ") << v[i];
std::cout << "\n";
return 1;
}
gives this output
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
0, 201, 2, 203, 4, 205, 6, 7, 8, 9
std::slice(1, 3, 2) defines a subset of a valarray containing 3 elements, starting at element 1 of the valarray, with each element of the slice separated by one valarray element (i.e. the slice references elements 1, 3 and 5 of the valarray ).
But I'd still use a vector - valarray doesn't have iterators and isn't a proper STL container.
</edit>
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Thanks, that was most helpful! And those articles made for some interesting reading...
As you say, a vector would be a better solution, in almost every way. I was only thinking about valarray because it looked like it could be useful. After reading those articles though, I think I'm going to "forget" that valarray even exists!
|
|
|
|
|
Hi friends
I would like to know if there is any difference between
the files, say test.dll and test.ocx ,if I simply change the output filename?.(Provided the same code is used for both files)
-friendly Dracula
|
|
|
|
|
|
Thank you Michael Dunn for ur reply.
-Friendly Dracula
|
|
|
|
|
I've been trying to use WTL controls in my large MFC based project. I've got the WTL7 libraries installed on my VC6 system. I can compile the WTL ctrl's sample code just fine, but when I try using it with MFC code, I'm getting all sorts of namespace collisions. CEdit, CButton, etc.
Can WTL and MFC code be intermingled? Does anyone have an example of how to do this? I'm guessing careful use of "using ... { ... }" is the key, or being more explicit with class names.
|
|
|
|