|
It's an interesting concept, though I have managed to do away with the thread altogether.
|
|
|
|
|
WalderMort wrote: It's an interesting concept, though I have managed to do away with the thread altogether.
well, then to quote one of my favorite movies....
"I am happy and sad for you."
I am glad you solved it, but sad you didn't get the thread going. threaded operations when written correctly can gain you a lot of time back. Though perhaps in this case it was really extra overhead. Still, I have many reader/writer threads running independantly, my whole streaming debugging system works under the multi-threaded ring buffer concept. (it's why it suddently occured to me, that has been stable for a year, so I haven't really thought about it since). It's a streaming writer with the debugs coming from multiple threads (multi-threaded write), and a single thread streaming the output of the embedded debugger to another computer. I have debugged in this fashion from 40 miles away using a packet radio, nifty.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
I can't see any obvious reason why the linked list would not work. Perhaps I misunderstand your situation? Anyway good luck with the screen sraping project.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
You mentioned earlier that you need to have at least 3 items in the que for it to work without problems, unless I missunderstood. In my situation there could be 0+ items.
|
|
|
|
|
Ahh I see, No it works with 0+ list items it just does locking in the normal way you'd expect until there are 3 items and then the locking is switched off until the queue shrinks again. The theory is that if you never have enough asynchronicity between your threads to get 3 items then you probably aren't pushing the system hard enough to need the extra performace of no locking.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Matthew Faithfull wrote: The theory is that if you never have enough asynchronicity between your threads to get 3 items then you probably aren't pushing the system hard enough to need the extra performace of no locking.
does that save you anything over a ring buffer? other than possibly memory use? seems more complicated than it should be. Esentially with a CAS operation on the ring buffer indexes, the locking/unlocking of your queue is identical but without the exceptional check for size, it just automatically occurs because of how the CAS works.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
El Corazon wrote: does that save you anything over a ring buffer?
I don't know. I'd have to look at the details of such a ring buffer. I've never coded one and it's many years since I studied them.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
|
Here is a basic question on Structures. Do Structures support inheritance and if so how different is it from Class inheritance?
---
Hakuna-Matata
It means no worries for the rest of your days...
It's our problem free, Philosophy
"I think my response was 'What idiot dreamed this up?'" -- Mary Ann Davidson, Oracle's chief security officer, in typical blunt manner, remembering her reaction to the company's scheme to brand its databases as "unbreakable."
|
|
|
|
|
Yes, structures do support inheritance in C++. If I remeber correctly the only difference now remaining between structures and classes is that structure members are public by default as opposed to protected . I generally use a struct by convention when the object I'm creating is data only, ie. it has no functions beyond possibly constructors. Occasionally I might use a struct with functions if I'm creating a type that's intended to behave like a built in type or a special translation type but that is a whole different tricky kettle of fish
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Generally a struct is for data only, and yes they can be inherited. You will sometimes see structs derived from the built in windows types. It's not often you will see member functions within a struct, though sometimes the need does arrise, especialy when overiding the comparison operators. Other than that, a structs members are public by default, whereas a class's members are protected.
|
|
|
|
|
Yes its possible on the C++ and C++.Net different is about access level also I think you need to see again about classes and structs so you will be see differences classes and structs.;)
|
|
|
|
|
Is there a way to add a new search engine(top right corner) in IE programmatically?
|
|
|
|
|
Can you more explain about search engine in IE,please?
|
|
|
|
|
Hello Friends,
Can anybody tell me how to retrive the handle of other window/s which is not the part of our application.
I am using global Mouse hook. and done the following things to get the handle of the window when user clicks on it, but it dont work.
I dont know what is the problem.
please Note I am using Win32 Application
Below is the code I use in Mouse Hook
<br />
...<br />
...<br />
if(wParam== WM_LBUTTONDOWN)<br />
{<br />
hWndActWnd = GetActiveWindow();<br />
if(hWndActWnd == NULL)<br />
OutputDebugString(L"Error, GetActiveWindow()");<br />
PostMessage(hWndApp,MOUSE_DOWN,(WPARAM)hWndActWnd,0);<br />
}<br />
...<br />
...<br />
And Below is the Code I use in My Application
<br />
...<br />
...<br />
HWND hWnd;<br />
case MOUSE_DOWN:<br />
hWnd=(HWND)wParam;<br />
break;<br />
...
|
|
|
|
|
Use WindowFromPoint() , then you can iterate through the parent windows to find the top level window.
|
|
|
|
|
Why MFC not supporting Multiple Inheritence ?could tell me the reasons , behind the architecture plz.
|
|
|
|
|
Krishnatv wrote: Why MFC not supporting Multiple Inheritence ?
it's C++, so it does.
what makes you say so ?
|
|
|
|
|
C++ Supports Multiple inheritence...that is OK .
Iam asking why MFC not supports Multiple inheritence.
|
|
|
|
|
Krishnatv wrote: Iam asking why MFC not supports Multiple inheritence
so i reapeat : WTF makes you say so ?
|
|
|
|
|
MFC does support multiple inheritance.
But its not designed in such a way.
Every(should be most) objects are derived from CObject, but none of them are virtual.
This makes that deriving from two MFC parent classes will result in two different root objects.
This is surely bad for the whole MFC design.
So one might say MFC doesn't support Multiple Inheritance in a Usable way.
Adding your own class(non MFC derived) should work.
codito ergo sum
|
|
|
|
|
One problem with MFC and multiple inheritance is that nearly all MFC classes are ultimately derived from CObject. If you then inherit from 2 MFC classes for a new class it gets 2 copies of CObject internally and which one existing code refers to is then ambiguous. This screws up things like MFC Serialization which rely on funtions inherited from CObject. The reasons why virtual inheritance was not used within the MFC Framework to prevent this being a problem are obscure. Someone with C++ guru status would probably be able to explain it.
I have a feeling that there are ways to make it work with a lot of effort becuase I remember seeing an article on CodeProject that claimed to have a solution. I didn't read it or save a link so you'll need to hunt for it yourself if you're interested.
In most cases multiple inheritance can be avoided anyway by making one of the bases a class member instead and exposing the parts of the interface you want by writing your own wrappers. Have a look at some of the tricks ATL uses aswell with template paremters used for base classes; an alternative powerful technique that can sometimes meet your requirements instead of using multiple inheritance.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Thank you for Nice reply.
|
|
|
|
|
Am I correct to say that if you build you own class - not MFC based - than you can do multiple inheritance in MFC "enviromwent"?
|
|
|
|
|
Matthew Faithfull wrote: Have a look at some of the tricks ATL uses aswell with template paremters used for base classes; an alternative powerful technique that can sometimes meet your requirements instead of using multiple inheritance.
That seems to say "use the ATL technique "instead of" multiple inheritance"
|
|
|
|