Q:Remoting and Threading

Q:Remoting and Threading

Post by Marc Eggenberge » Wed, 06 Mar 2002 00:26:15


I have a running Environment.

I have a RemotingServer which has a Public Class EntryPoint which
registers a serverchannel. the client creates such an object from that
class. The Server Part has a class WordRemoting with several functions
where one public named CreateWordDoku is the important (Public Function
CreateWordDoku(ByVal Vorlage As String, rs as DAO.Recordset, rs2 as
DAO.Recordset) As Boolean Implements

This one creates a Wordapplication via COM, loads a .dot runs a Macro
and then saves the WordDocument.

This works perfect. The whole process takes about 4.5seconds.
For a batchversion which will be run and will process about 3000 Letters
I want to do Threading because the server is a 4cpu server and to my
knowledge if I run this normally it just uses one CPU (cant test it
right now, test env is a single cpu, new server will only arrive in 4
weeks ;( ...) or is this wrong ...

if this is true and want to do multithreading.
I think of a CreateWordDokuBatch(somesortofarray as Collection) as
boolean .... something like that.

then loop through the Collection, create a Thread (if maxthread is not
yet reached) and have within that thread the normal function
CreateWordDoku executed.

All how-to's I found about threading are those little, create 5 threads
and do a hello world from each thread. No passing data and calling
function etc ...

is there any extended how-to's or does someone has some code snippets?

Marc Eggenberger


Q:Remoting and Threading

Post by Imtiaz Hussa » Thu, 07 Mar 2002 00:42:19

The following link has some good samples on .net remoting
It has about 4 samples which talk about different aspects of multithreading.
A few samples are provided with the .net framework. Typically they can be
accessed at the following location on the disk.
C:\Program Files\Microsoft Visual Studio

Imtiaz Hussain
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.