| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10
Comments:
<0> it's bad design to create threads from a dll <1> i need it to improve performance of an app <0> but you can use something like WaitForSingleObject/WaitForMultipleObjects and wait for the thread handle to signal <0> and then execute code <0> there is DLL_THREAD_DETACH in DLLMAIn <0> but it's easy to cause deadlocks by putting code there <1> does DLLMain run in the same addr space as the process that is loading/unloading it ? <0> of course <1> its seems like it spawns an extra thread just for DLLMain <1> when its loaded/unloaded <1> and if i want to create an extra thread in DLLMain my program hangs, because its wating for DLLMain to finish <1> and DLLMain does not finish because it spawned a new thread <0> you can <0> yyou can't do that in dll main <1> well currently i have an exported function Initialize/Destroy to spawn/destroy extra threads <0> that is correct
<1> and i need to make sure that when dll is unloaded Destroy is called automatically <0> right <1> i am trying to make a singleton object <0> or you can make sure it doesn't get unloaded while the extra threads are running <1> that auto-intializes and auto-destroys on load/unload <1> hm <0> there's a refcount maintained to see if a dll can be unloaded <0> so you need to bump it up for every extra thread spawned <0> and then release it before a thread exits <0> then the dll will not be unloaded while the extra threads are running <0> but like I said, it seems like a bad design <1> whats wrong with having singletons in dll <1> if you want to sup up sound in your application <0> 1) singletons are usually a bad design <1> wouldn't it be nice to have a dll that will create a sound server and all you have to do is control it via exported functions <0> 2) dlls are not good candidates for a singleton <0> and you can't make it an exe ? <1> hmm <1> well my other choice is to make an exe <0> make it and exe then <1> and make a dll that will talk to exe via some process to process communication <0> you can use COM maybe <1> i have an app that allows dll extensions <1> so i need to use a dll <0> can you make an COM exe server ( singleton) and call it from the extension dll <1> hmm <1> do you have some functions that i can look at to learn more on how it works ? <0> google for ATL <1> what does it stand for ? <0> active template library <1> wow, neat <2> .. or maybe u need something more like a service <0> CLoud: is this for school? <1> no, its a hobby <1> trying to sup up an application <0> do you need a singleton in the context of a single process? <1> yeah <1> well <1> it could be in another process <1> but there has to be some way to communicate with it via dll functions <0> COM <0> from extension <0> or make it a dll, and dance around all the multithreading issues there <3> HEy guys, I need some help starting a project, what's the easyest way to <3> create a board to the console of a board,9x9 then be able to keep track <3> of each sqare.... just need some help starting that so i can do the rest <3> any suggestions.... and it's in c++ <1> c_help : what system are you running on ? <1> i knew Com would come back and bite me in the *** someday <0> lol <1> i tried to avoid it as much as possible <3> unix console <0> Cloud: why do you need multithreading again ? <1> the exported functions use SDL library that needs a worker thread <1> so when i call Initialize a new thread is spawned <3> cloud_99: i'm on windows, but using a AIX compiler <0> Cloud99: and what is the problem? <1> when the app closes a window it kill one of the main threads and crashes <1> this does not happen if you somehow call SLD_Quit procedure before exit <1> i can't do it in DLL_main and can't do it in the app, unless i manually call it <1> the app is a telnet program
<1> i have to manually type /calldll this.dll command <1> btw <1> do you know any good books on COM ? <1> might as well learn it <0> the extension dll must be notified from the main app on exit, no ? <1> it is not, the only exit that i can detect is through DLLMain <1> but that does not help <0> it ****s that the main app doesn't notify the extension of a shut-down properly.. <0> sounds like a design flaw <1> well the whole extension thing was designed only to perform text processing and return back a result <0> usually extensions export a shut-down function of some sort <1> i am abusing it <1> its like taking a small toyota and turning it into a pick up track <1> err truck <0> you'll have to hack it <1> do you work with COM a lot ? <0> I do somewhat <1> whats good about it ? <0> it's a prepackaged solution for solving some problems <0> no need to reinvent the wheel <0> Do you need to call SLD_Quit ( I ***ume a 3rd party lib?) <1> yeah <1> there is one small hack <1> when dll is loaded <1> the app calls an init function on its own <1> i am thinking of putting atexit there <0> do you control application code at all? <1> not really <1> all i can do is type something in it and it will call a function in dll with parameters <0> it's a bad design of the extension interface <0> there should be some init() and Uninit() exported and called by main app <0> which is where you'd do the work to create 3rd party stuff, and then shut it down/cleanup <0> actually, COM won't help you in this situation <0> by the time you know you need to clean up, it's too late to do anything, because you're under a loader lock <0> so find a way to get notified from main app <0> before the unload happens <2> I just post some question uin chanel C#, no one is answering ... appreciate itif anyone can help me there <4> C# is closer to Java than it is to C++ <5> what's the difference between a float and a double? <6> float is double precision float <6> err <6> double is a double precision float <7> Is double the most precise you can get? <6> using primitive variable types, yes <6> it is possible to get arbitrary precision, but it will be much slower and unless you're doing extremely accurate scientific modeling it's pretty much a waste <4> there is long double, too <4> and though it's not part of C++, some compilers (like g++) will let you use special flags to make them larger (and more precise) <2> damn... I have devenv.exe in the Windows Task Manager Process tab that cannot be terminated... any idea how to kill it? <8> hi ] <8> im trying to use a cl*** in my program , i created a cl*** but when i compile i receive this <8> Linking... <8> LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main <8> Debug/project1.exe : fatal error LNK1120: 1 unresolved externals <8> Error executing link.exe. <9> did you have a main()? <4> and did you put main() in the cl***? <8> no <4> (that would be bad) <8> i didnt put a main in the cl*** <9> do you have a main() at all? <8> i dont have a main at all <8> what means this error <9> georgesUHF: it means it's looking for a main() to link to and can't find one <8> what i have to do ? <10> add a main() <8> where ? in a cpp file for ex ? <9> sure <8> i did <9> you said you didn't.... <10> lol <8> now i added after u told me <10> main = entry point of your program <8> yes
Return to
#c++ or Go to some related
logs:
#chatzone espenado #MissKitten #linuxhelp #linux #c #teens What American university provides the setting for Love Story
raining cats and dogd #linux
|
|