Is DLL running in Multi-thread or Single-thread?

4 views
Skip to first unread message

Leonardo Carreira

unread,
Feb 15, 2011, 11:30:01 PM2/15/11
to Crypto++ Users
Hi Friends..

I've a little doubt regarding DLL...
Let's say we've already developed the DLL's function using Cryptopp
(to Generate RSA Key Pair 2048 bits)..
After estimated, it needs approximately 3s..
What will happen if more than 1 process use the DLL's function at the
same time?..
Whether each process will get (different) its own KeyPair (Private &
Public Key), or each process will get the same KeyPair?

I mean, whether the functions in DLL is can be used Multithreadly?
So, multiple processes can use the functions at the same time, without
any error (either program error, or unexpected output) occurred?

Please help me regarding this..

Thanks

Leo

Jeffrey Walton

unread,
Feb 15, 2011, 11:58:18 PM2/15/11
to Crypto++ Users
> So, multiple processes can use the functions at the same time, without
> any error (either program error, or unexpected output) occurred?
Code (ie, instructions in a function) usually does not matter since
code is generally read only. All processes can (and do) share code.

Global data is different. Unless global data is placed in a shared
data segment (usually via a pragma and DEF file), each process gets
its own copy of the global data. So the data is global for a process
(for all threads in the process); and not system wide for all
processes.

Shared data segments are highly discouraged since one process can
corrupt the data/state of another process.
http://msdn.microsoft.com/en-us/library/h90dkhs0(v=vs.80).aspx.

Jeff
Reply all
Reply to author
Forward
0 new messages