473,385 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Treads Vs Process

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?

What is the difference between a process and a thread and is all .net
code executed in the same process.

Any help appreciated

Apr 12 '07 #1
2 2385
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/
Apr 12 '07 #2
On 12 Apr 2007 05:26:39 -0700, 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.
Beware that Windows Services run under their own user accounts (LocalSystem
by default IIRC) and have their own window station and desktop. This means
that if the Windows applications that you are starting from your windows
service have a UI, it won't appear to the user by default. On top of that,
depending on which application you start, you might be opening security
holes in your system by doing that.
Apr 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sean | last post by:
I can connect to a machine remotely with no problems but I'm having trouble trying to create a process remotely. Initially this was a perl and VB script which I'm converting to python. Its entire...
0
by: Justin Johnson | last post by:
Hello, I was wondering if anyone has seen this behavior before for the process.py module available at http://starship.python.net/crew/tmick/. I've been using it quite well on windows 2000...
1
by: Peter Åstrand | last post by:
There's a new PEP available: PEP 324: popen5 - New POSIX process module A copy is included below. Comments are appreciated. ---- PEP: 324 Title: popen5 - New POSIX process module
11
by: Mike M | last post by:
Is it possible? In the parent process, I have a socket that binds, listens and then accepts new connections (which creates new sockets in the process). I want to be able to pass some of these new...
2
by: RL | last post by:
Hello Perl gurus, 1. I have a web page where I can push a button (dospawn.html). 2. This button calls a CGI script (spawnboss.cgi) 3. spawnboss.cgi calls a forking perl script (forkme.pl) 4....
12
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am...
10
by: Sorin Dolha [MCSD .NET] | last post by:
I would like to start a process from C# code as another user. The C# code is executed as the ASPNET user because it relies in a Web Page class, and I would like that the process will run as another...
11
by: Jon Davis | last post by:
Does anyone know why using System.Diagnostics.Process to "wrap" a console application does not always transmit the I/O, depending on what processes you're trying to "consume"? PowerShell, for...
4
by: =?Utf-8?B?U3Jhag==?= | last post by:
There is a process A that launches process B as a COM object. If the User tries to end process A, process B should also end. But vice versa is not true. Process A can run independant of process. It...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.