|
|
Thanks! I found it!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Deal!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
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]
|
|
|
|
|
yeah, I thought he was kidding until I googled it for him ....
'g'
|
|
|
|
|
Some people are smarter than others...
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Thanks!
You've got a nice child (in photo)!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
I forget the name of Disney Character in this serial. Is It BAALU?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
No.
:laugh: BALOO
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
I want to learn how to work with threads. I tryed the MSDN example
http://msdn.microsoft.com/en-us/library/kdzttdcb(VS.80,printer).aspx[^]
and it doesn't work. I'm receiving the message:
Compiling...
th.cpp
C:\programare\th\th.cpp(46) : error C2065: '_beginthread' : undeclared identifier
C:\programare\th\th.cpp(83) : error C2065: '_threadid' : undeclared identifier
C:\programare\th\th.cpp(120) : error C2065: '_endthread' : undeclared identifier
Error executing cl.exe.
What can I do ?
In VC++6 please...
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
are you
1) including <process.h>
2) linking against the Multithreaded libraries ? (Go to Project -> Settings, and select the C \ C++ tab. Under 'Category', choose 'Code Generation', and choose the Multithreaded Static item under the 'Use run-time library:' combo.)
?
|
|
|
|
|
Now it works!
Thanks a lot!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
When the file is first open a read all around, it take about 40s. (The file is about 100MB)
Then I re-run it, it takes less than 1s.
And I tried to read the another file in the same directory, it takes less than 1s.
(the 2nd file is about 80MB).
Is it caused by the disk cache?
But I think the os should cache contents for the file under reading,
because the file is not necessary continuous on the disk.
So how could the 2nd file be read so fast? Because the os cache files in the same directory?
In my experince, some times it seems true, and sometimes not.
Is there any guide to make good use of the cache?
And I'm going to use the file mapping mechanism, will it be much faster?
PS: The size per file is about 100MB, and total size in one directory is about 1GB.
modified on Saturday, January 17, 2009 5:14 AM
|
|
|
|
|
Well, maybe the hard disk hard gone to sleep?
Reading the first file woke it up, moved the head to the right place on the disk, then splat, fast data.
On the next read, you're already at the right place and speed, so splat once more!
There's a huge difference between data rate and seektime. Just like you can have fast bandwidth, but high lag on an internet connection.
So, under my theory, whether you use ReadFile or memory mapping is irrelevant.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
I've tested the two mechanisms several times fairly.
23 files, 2.05GB
When not using file mapping it takes about 250s.
Otherwise, it takes about 150s.
And your theory explains why sometimes it is slow and some times it is fast randomly.
|
|
|
|
|
followait wrote: And I'm going to use the file mapping mechanism, will it be much faster?
PS: The size per file is about 100MB, and total size in one directory is about 1GB.
If you read the whole of the file into memory at once, file mapping isn't much faster in my experience. Best thing to do is abstract the file accessing mechanism into a separate class or module, so you can change it without impacting the rest of your code. Then you can try both methods and do some objective measurement - that's the best way to tell which approach is better for your scenario.
|
|
|
|
|
I've tested the two mechanisms several times fairly.
23 files, 2.05GB
When not using file mapping it takes about 250s.
Otherwise, it takes about 150s.
|
|
|
|
|
followait wrote: When not using file mapping it takes about 250s.
Otherwise, it takes about 150s.
Tells you all you need to know
The most I've file-mapped is ~ 1GB. But that was in a single file...on a PC with 1GB RAM. Obviously, i couldn't just map all of it at once, so I ended up writing a custom STL iterator (using the splendid Boost.Iterator[^] library) that would map parts of the file in and out (thank you, MapViewOfFile [^]) as I navigated through the file.
Worked really nicely and with little to no performance hit - I was processing that sucker with standard STL algorithms (e.g. binary_search to find a particular artefact) and it felt FAST...
|
|
|
|
|
Hi all,
I need win32 API to close any window(ex:IE) forcibly.Lets take one scenario.
Steps:
1.Install toolbar(Yahoo/Google)
2.Open IE.
3.Close IE.// Here unless until we are closing toolbar popup window we can't close browser window.
But I need API to close browser window without interacting with toolbar window.
Thanks...
|
|
|
|
|
You can use PostQuitMessage API to tell the window to close.
If you want to force a close you can use TerminateProcess to kill the process.
But does not guarantee proper cleanup.
«_Superman_»
|
|
|
|
|
You can send WM_CLOSE to programs.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I have tried with WM_CLOSE, but it is not working.Better if sending the code.
|
|
|
|
|
You need to get handle of programs(HWND) and then you can use of SendMessage for close them.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
FYI: In widows task manager we are able to 'End Task' any application.I read one article, it was written to use EndTask() API to close any app forcibly. But my compiler is flashing error.I think it doesn't exit in VS2008 express edition.
|
|
|
|
|
What was the error?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|