Erick wrote:
I've create a windows service which will start any windows application
whose name it finds in an xml file i have pointed it to.
However, I also want it to create .net objects from assemblies (dll's)
I want these objects run in the background. I have used reflection to
find the assembly and the object type.
I want these objects to run separately to the windows service. Do i
start these objects in a new thread or do they need to start in a new
process?
Objects are code and data. They don't represent a running thread of
execution unless you explicitly create a thread of execution call into
them. So, you either need to create a thread and call a method on the
object from that thread, or you need to create a wrapper process which
calls into the object.
What is the difference between a process and a thread
Briefly, a process is a notional owner of a set of resources that are
all collectively used and shared in the execution of a program. One of
the kinds of resources is a thread; another is a file handle. Processes
are a useful abstraction in operating systems so that resources can be
reclaimed when the process exits (terminates).
A thread represents a single logical thread of execution, that is, a
logical CPU consecutively executing instructions from memory. Both
memory and threads are resources owned by processes.
Every process has at least one thread, and if all threads in a process
exit, the process exits.
and is all .net
code executed in the same process.
No.
-- Barry
--
http://barrkel.blogspot.com/