login about faq

Should I call CkSettings::initializeMultithreaded() just only once in a multithreaded program? I have a multithreaded program include a couple of classes/COMs. Each of them has already called CkSettings::initializeMultithreaded() once.

Would it be wrong if I call CkSettings::initializeMultithreaded() more than once in a multithreaded program? Would it be OK if I never call CkSettings::initializeMultithreaded() in a multithreaded program?

Tom

asked Sep 09 '12 at 22:18

hsujong's gravatar image

hsujong
263313


I once had a similar question (by email in 2009). Here my original question:

We develop an EXE and several DLLs. Only some of the DLLs use Chilkat libraries and are linking to it.

So: EXE doesn't use chilkat DLL-1 doesn't use chilkat DLL-2 uses the email components DLL-3 uses the FTP components

Sometimes EXE only uses DLL-1 (no chilkat libs), sometimes only DLL-2 (email), sometimes only DLL-3 (FTP), sometimes all 3 DLLs....

Where should we call CkSettings::initializeMultithreaded() do multiple calls cause trouble (called in both DLL-2 and DLL-3)? is it possible to call it in the EXE only?

Where should we call CkSettings::cleanupMemory() do multiple calls cause trouble (called in both DLL-2 and DLL-3)? is it possible to call it in the EXE only?

Can we call UnlockComponent for the various chilkat components we use in the EXE only (at startup)?

And here Matt's response

1) Don't worry about calling cleanupMemory -- it only exists for those
programmers wanting to verify that there are no memory leaks at program
exit.  Here is more information: http://www.chilkatsoft.com/p/p_109.asp

2) Call UnlockComponent once in each DLL/EXE that uses Chilkat.

3) initializeMultithreaded does nothing and probably never will.  I
would simply omit it at this point.  If it is ever required, it will be
in the release notes of a future version.
link

answered Sep 10 '12 at 04:33

Gert's gravatar image

Gert ♦
629141824

Thanks Gert!

Yes, the call to initializeMultithreaded can still be left out. If you wish to be more explicit about the fact that your program is multi-threaded, it might be worth adding.

link

answered Sep 10 '12 at 12:15

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×4

Asked: Sep 09 '12 at 22:18

Seen: 897 times

Last updated: Sep 10 '12 at 12:15

powered by OSQA