|
Thank you, very interesting.
I'm moving on to C++/CLI programming in MsDev 2008 soon. Do you know of any similar problems with the equivalent .NET synchronisation classes (e.g. Mutex) ?
|
|
|
|
|
I don't pretend to be a .NET expert, but I can almost certainly say that you won't face such issues (as listed in the article by Joe) with .NET. I say it because everything is taken care of by the framework for you (how it does internally is another thing) and it's pretty impossible to shoot yourself in the foot with .NET.
Unfortunately, that doesn't stop a programmer from writing bad code and therefore, a badly formed, bloated, etc., program is possible to write. So, if you use a synchronization object improperly, expect the program to be slow. Things like memory damage, memory/resource leak, memory fragmentation, etc., are impossible though (I chose C# over C++ for a couple of server programs that I wrote for this reason).
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
LetsMond wrote: It seems that just calling "CSingleLock::Lock" is enough to slow my thread down, regardless of whether the mutex is locked by another thread.
Locking a mutex is quite an expensive operation, even if the lock operation is immediately successful. In addition, the lock attempt (using, for example, WaitForSingleObject) is a kernel synchronisation point, which allows higher priority threads to take over the thread's time slice. Sounds like this is what's happening?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
LetsMond wrote:
Has anybody out there encountered a similar issue when using low priority threads?
Absolutely.
LetsMond wrote:
Is this a common feature of multithreading which I just haven’t seen before?
You will probably get better performance using the Interlocked Functions[^] rather than the CSingleLock class[^]. In high-performance threads you need to avoid synchronization with kernel objects.
Note that all synchronization techniques are relatively expensive because all of them use a memory barrier[^] which essentially means that are using SFENCE [^]or MFENCE[^] instructions to serialize memory access.
Best Wishes,
-David Delaune
|
|
|
|
|
How to add a CEdit-derived class output the text/icon in the beginning and-or in the end of CEdit window.
I can allocate an area for the text/icon by SetMargins method, but in what method and how is better output a text or icon not clearly.
It is desirable, that other CEdit functional was not broken
Similar to CEdit from Data group and MsgID groups (http://www.canusb.com/canusb_labview.jpg[^])
|
|
|
|
|
|
hi guys
i try copy some chinese word "你好" from a .txt file as edit control's caption
but i fail.it show some garbled text
how to solve this problem
could help me
thank you;
|
|
|
|
|
Hi,
What do you mean by it fails? The garbled text is in Chinese or not? If not Chinese, do you see question marks instead? Is your application fully Unicode?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: Hi,
What do you mean by it fails? The garbled text is in Chinese or not?
We have nothing, so far. We need facts, Watson, facts!
--Sherlock Charles
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
open ur .rc file in notepad and save it as unicode...
|
|
|
|
|
ali kanju wrote: open ur .rc file in notepad and save it as unicode...
Uh...What? I have no .rc file, but I don't care at all. On the other hand, I need facts...
--Sherlock Charles Again
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Facts, facts. For instance is a fact that you missed the OP, replying instead to me.
--Sherlock Charles Again & Again
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
OP - O riginal P ost.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
|
What do you mean by it fails?
A:fail is means after copy the chinese word is not i want just so;
The garbled text is in Chinese or not?
A:the garbled text is also chinese
you can see below:
when before copy chinese word "你好"
after copy the chinese word in edit caption is "斕疑"
Is your application fully Unicode?
A:my application's character set is MBCS
|
|
|
|
|
jeansea wrote: A:my application's character set is MBCS
To begin with, you can do an Unicode build.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
What do you mean by it fails?
A:fail is means after copy the chinese word is not i want just so;
The garbled text is in Chinese or not?
A:the garbled text is also chinese
you can see below:
when before copy chinese word "你好"
after copy the chinese word in edit caption is "斕疑"
Is your application fully Unicode?
A:my application's character set is MBCS
|
|
|
|
|
Hi,
I have just moved from MSVC6.0 to VS2008 and I am having a little difficulty finding things. Can anyone please tell me how I can access message maps and member variables of a dialog from the resource? It sued to be that you right clicked the dialog and chose Class Wizard but all that has changed.
Thanks
Tony
|
|
|
|
|
u may not find the old class wizard as it was in previous versions...rigth click on any control to add variables and message handlers...
|
|
|
|
|
Thnaks but can you tell me how to access exisitng handlers and variables. I want to remove a variable and a handler so I can delete the controls from the dialog.
|
|
|
|
|
Go to Class View. Select the dialog's class. Go to the Properties window (right-click on the class and select Properties). The tool bar at the top of the Properties window has icons for events (the little lightning bolt), which gives you access to dialog control notification handlers (you can create or delete handlers or navigate to them from here).
The other icons on this toolbar are Messages (handlers for Windows messages sent to the dialog class) and overrides (base class overrides, obviously).
If someone can suggest a shorter way to this window, from the resource editor, say, I'd like to know
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
How to find the numeric position of the first occurrence of a string in another string?
|
|
|
|