|
Start with C++ and use memory mapped files. (Last year I wrote a module that accepted huge text files of data pushed out from an Oracle server. My first prototype used buffered I/O to read the files. I then switched to using memory mapped files and good old pointers and reduced the parse time by over 90% (seriously--it went from several minutes to under 5 seconds.))
For lookups, there are various schemes, but a Trie may be the best for this. Be aware, however, than many implementations allocate each node. This will slow you down tremendously. What you want is a fixed memory allocator. (Yes, I have such a class and am debating publishing an article on it, but the current implementation relies on my personal class library which is, to say the very least, ecletic.)
|
|
|
|
|
I'd go with STL
Regards,
Brian Dela
|
|
|
|
|
I have been thinking about one thing, if I don't use async sockets and make a multithreaded server.
How can my connected clients to the server communicate?
ie. A global std::list is toooo risky if two threads try to acces that object at the same time, right?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
If it's multithreaded... yeah! Just use a mutex.
Then only one thread can read/write the gloabl shared data, the other thread(s) have to wait until the shared data is unlocked. Lock shared data as short as possible.
|
|
|
|
|
|
ah yes... I use it too.
CCriticalSection m_NodesListAccess; //synchronize access on lists/maps
m_NodesListAccess.Lock();
m_NodesListAccess.Unlock();
For some (strange) safety reasons I use it even in my async socket class, but I might be overprotective....
|
|
|
|
|
Moak wrote:
but I might be overprotective
yeah, like Britney Spears... LOL!
So if I access a global std::list between m_NodesListAccess.Lock(); and m_NodesListAccess.Unlock(); all other threads have to wait untill current thread has m_NodesListAccess.Ublock(); ?????
Cool... but... I'm not using MFC... I think this is an MFC class, right?
So, how to do it in Win32 API??
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Rickard Andersson wrote:
So, how to do it in Win32 API??
Found an article here on CP!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Hi,
I cannot got my dll because of this
Creating library Release/AutoRecAndSave.lib and object Release/AutoRecAndSave.exp
LINK : warning LNK4089: all references to "comdlg32.dll" discarded by /OPT:REF
Tell me how to fix it.
Thank u in advance
Extreme programming. Do the No.1
|
|
|
|
|
What is there to fix?
Somewhere in your code you have included a line
#pragma comment(lib, "comdlg32")
but in the end (at link-time) it turns out you never used any function from that library/DLL and therefore it's discarded.
|
|
|
|
|
I mean, I can't make dll because of this, cannot MAKE DLL.
Extreme programming. Do the No.1
|
|
|
|
|
This is only a warning, so this can't be the cause that you can't build the DLL. I have this warning in a few DLL projects as well, but all compile fine anyway.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
To get rid of this warning, go to the command line section of the linker options and add
/IGNORE:4089
But this is just a warning and is completely benign, so if you aren't linking this isn't the problem.
|
|
|
|
|
Why do you say turn off the warning? Why not fix the problem that's causing the warning?
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I'd say because it's not worth it. Most warnings should be addressed and fixed, but a few, like this one are just not worth the trouble. I can list you a couple of other compiler warnings which I've disabled:
4786: identifier was truncated to '255' characters in the debug information
4355: 'this': used in base member initializer list
Do you think it's worth fixing these? If so, how would you do it?
Regards,
Alvaro
There is much pleasure to be gained from useless knowledge. - Bertrand Russell
|
|
|
|
|
Michael Dunn wrote:
Why not fix the problem that's causing the warning?
Because often you can't for this specific warning which is generated because the linker COMDAT optimization made the library no longer necessary, though it was before the optimization.
[Link message] 4089 is an purely informational message and should be labeled as such--it is not a warning in any commonly accepted way. In other words, the presence or absence of this warning has no bearing on whether an executable will or will not work.
|
|
|
|
|
I have alot of pages. I can only seem to get 16 pages on one row. Is there away to make ten pages on one row and ten more pages on another row?
Please, any response any one can give me will be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
You mean something like this?
|
|
|
|
|
Yes, yes, yes. How? How? How?
|
|
|
|
|
I fake it by padding the tab names with spaces. Not foolproof, but it works almost all the time.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello
I want to add to my application the type of tabbed control that can be seen in MSVC as the 'Workspace' view. Its the tabs with the classview/resource/file tree's that's normally on the rhs of MSVC. How do I do this?
I'm using the doc-view architecture, and I want this CTabCtrl to be in one of two windows in a splitter wnd. It will be used to select between differing views of the data set that is displayed graphically in the rhs split window. There will be a fixed number of viewingmodes, each corresponding to a tab in the lhs tab ctrl.
Could anyone explain to me the sequence of classes I need to create to achieve this type of control? Can each of the tabs in the control represent a 'CView' derived class? Where should I attach them to the tab-ctrl?
All help or comments appreciated. Please don't redirect me to the (great) tab control samples that codeproject has : none of them are what I need, I've looked at them all.
Cheers,
- solosnake
|
|
|
|
|
MFC's ASyncSocket class provides a wrapper around a Win32 socket and adds functionality to detect events (such as connection, packet received etc). Now I'm aware that a similar method can be performed using plain winsock programming and the use of WSAAsyncSelect. However, it requires the use of a window to receive events (CAsyncSocket does it like this as well doesn't it?). I've seen code that sets up a thread and just waits on recv() using a spin-lock - this seems to go against the grain with me though. I have noticed the select() fn, but I'm not sure if it would truly be thread friendly or would just hide a spin-lock. So, to my question: Is it possible to detect an event from a Socket without resorting to window messages or requiring a spin-lock?
Phil
|
|
|
|
|
A website[^] you'll love.
How low can you go ? (MS rant)
|
|
|
|
|
You might find WSAEventSelect interesting.
--------
There are 10 types of people in this world. Those who know binary and those who don't.
|
|
|
|
|
Hi all,
I have an owner draw list ctrl.
i want to force a vertical scroll to be shown when the dialog
that the list sits on appears.
this is the code i've tried :
ListView_SetExtendedListViewStyle(m_lc.m_hWnd,
LVS_EX_FLATSB|LVS_EX_FULLROWSELECT );
now i've inserted some columns and then:
m_lc.ModifyStyle(0,WS_VSCROLL);
m_lc.SetScrollRange(SB_VERT,0,100);
m_lc.SetScrollPos(SB_VERT,0);
m_lc.ShowScrollBar(SB_VERT);
this doesn't show the vertical scroll bar.
the bar only show when the limit of inserted items succeeds.
can any1 show me what to do in order to force the scroll bar?
thanks in advanced
Yaron
Ask not what the application can do for you, ask what you can do for your application
|
|
|
|