473,378 Members | 1,400 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,378 software developers and data experts.

Share dll object

anybody knows how to share the dll between the process? I know there is a way
to set the #pragma data_seg in the visual studio 6.0 C++, that can make the
dll can be shared between the multiple processes. but how to do it in .net?

--
ISAMUSETU
Nov 17 '05 #1
7 4866
Remoting?
What exactly do you want to share?

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"isamusetu" <is*******@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
anybody knows how to share the dll between the process? I know there is a
way
to set the #pragma data_seg in the visual studio 6.0 C++, that can make
the
dll can be shared between the multiple processes. but how to do it in
.net?

--
ISAMUSETU

Nov 17 '05 #2

"isamusetu" <is*******@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
anybody knows how to share the dll between the process? I know there is a
way
to set the #pragma data_seg in the visual studio 6.0 C++, that can make
the
dll can be shared between the multiple processes. but how to do it in
.net?

--
ISAMUSETU


What exactly do you need to share?
#pragma data_seg does not share a DLL!, it shares the "named" data segment
only, this option is not available (not needed) for managed code.
If it's your intention to share raw data your best option is memory mapped
files, when you need to "share" object instances take a look at remoting.

Willy.
Nov 17 '05 #3
Thanks, what I need is share the object between the process, because we are
thinking to make a project which will has 3 layers(web server, app server,
database server), for example, the app server will incharge the database
access, if the database connection object can be shared between the processes
on the app server, this object dont need create and disposed time to time.

Thats my target, and you said the remoting can implement it, I see. is there
any other way to do like remoting(more simple more better)

Warm regards.
--
ISAMUSETU
"Willy Denoyette [MVP]" wrote:

"isamusetu" <is*******@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
anybody knows how to share the dll between the process? I know there is a
way
to set the #pragma data_seg in the visual studio 6.0 C++, that can make
the
dll can be shared between the multiple processes. but how to do it in
.net?

--
ISAMUSETU


What exactly do you need to share?
#pragma data_seg does not share a DLL!, it shares the "named" data segment
only, this option is not available (not needed) for managed code.
If it's your intention to share raw data your best option is memory mapped
files, when you need to "share" object instances take a look at remoting.

Willy.

Nov 17 '05 #4
But why would you share a Database connection object if only the app server
is in charge of the DB access?

Willy.

"isamusetu" <is*******@discussions.microsoft.com> wrote in message
news:92**********************************@microsof t.com...
Thanks, what I need is share the object between the process, because we
are
thinking to make a project which will has 3 layers(web server, app server,
database server), for example, the app server will incharge the database
access, if the database connection object can be shared between the
processes
on the app server, this object dont need create and disposed time to time.

Thats my target, and you said the remoting can implement it, I see. is
there
any other way to do like remoting(more simple more better)

Warm regards.
--
ISAMUSETU
"Willy Denoyette [MVP]" wrote:

"isamusetu" <is*******@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
> anybody knows how to share the dll between the process? I know there is
> a
> way
> to set the #pragma data_seg in the visual studio 6.0 C++, that can make
> the
> dll can be shared between the multiple processes. but how to do it in
> .net?
>
> --
> ISAMUSETU


What exactly do you need to share?
#pragma data_seg does not share a DLL!, it shares the "named" data
segment
only, this option is not available (not needed) for managed code.
If it's your intention to share raw data your best option is memory
mapped
files, when you need to "share" object instances take a look at remoting.

Willy.

Nov 17 '05 #5
if the database connection object is always in the memory, I don't need to
new() and dispose() it time to time right? if there isn't, when the module A
startup, A should new a object and dispose it when A exit, and module B
startup, B should new a object and dispose it same as A did, that will take
the cpu time.

the database connection object is just a sample here, if we hava some dll
can be used for lots of modules, if those objects in the dlls can be created
only once, I think the system will be faster.

Sure I know some object can not be shared between the different processes,
but would you tell me is there the way to implement this function in the .net?

--
ISAMUSETU
"Willy Denoyette [MVP]" wrote:
But why would you share a Database connection object if only the app server
is in charge of the DB access?

Willy.

"isamusetu" <is*******@discussions.microsoft.com> wrote in message
news:92**********************************@microsof t.com...
Thanks, what I need is share the object between the process, because we
are
thinking to make a project which will has 3 layers(web server, app server,
database server), for example, the app server will incharge the database
access, if the database connection object can be shared between the
processes
on the app server, this object dont need create and disposed time to time.

Thats my target, and you said the remoting can implement it, I see. is
there
any other way to do like remoting(more simple more better)

Warm regards.
--
ISAMUSETU
"Willy Denoyette [MVP]" wrote:

"isamusetu" <is*******@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
> anybody knows how to share the dll between the process? I know there is
> a
> way
> to set the #pragma data_seg in the visual studio 6.0 C++, that can make
> the
> dll can be shared between the multiple processes. but how to do it in
> .net?
>
> --
> ISAMUSETU

What exactly do you need to share?
#pragma data_seg does not share a DLL!, it shares the "named" data
segment
only, this option is not available (not needed) for managed code.
If it's your intention to share raw data your best option is memory
mapped
files, when you need to "share" object instances take a look at remoting.

Willy.


Nov 17 '05 #6
Thank you, you can see what I want to do below.

--
ISAMUSETU
"Miha Markic [MVP C#]" wrote:
Remoting?
What exactly do you want to share?

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"isamusetu" <is*******@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
anybody knows how to share the dll between the process? I know there is a
way
to set the #pragma data_seg in the visual studio 6.0 C++, that can make
the
dll can be shared between the multiple processes. but how to do it in
.net?

--
ISAMUSETU


Nov 17 '05 #7
Hi,

"isamusetu" <is*******@discussions.microsoft.com> wrote in message
news:FA**********************************@microsof t.com...
if the database connection object is always in the memory, I don't need to
new() and dispose() it time to time right? if there isn't, when the module
A
startup, A should new a object and dispose it when A exit, and module B
startup, B should new a object and dispose it same as A did, that will
take
the cpu time.
It is a bad example. You should use connection object per thread and it
should be opened as late as possible and closed asap.
Sharing such object doesn't make sense and performace will go down to the
ground.

the database connection object is just a sample here, if we hava some dll
can be used for lots of modules, if those objects in the dlls can be
created
only once, I think the system will be faster.
No it won't. Generaly speaking you are better off creating each object in
the application itself - otherwise you'll loose time with remoting (it costs
you) and also you'll have to implement locking mechanism which might be a
bottleneck and again, you can loose much time here. You should consider
sharing objects in rare cases.
Another problem is that if you implement remoting your shared objects have
to live in a separata process (which will consume resources and cpu cylces,
too).

Sure I know some object can not be shared between the different processes,
but would you tell me is there the way to implement this function in the
.net?


So, the bottom line is - avoid sharing unless really necessary.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
Nov 17 '05 #8

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

Similar topics

3
by: music4 | last post by:
Greeting, My platform is Solaris 2.8. My question is that if there is a simple way to put a class object in share memory, so that multiple process can use this object. Thanks in advance! Evan
6
by: Tony Fonager | last post by:
I am currently developing a statistics system in ASP.NET, and need to share information about the customers websites, in this application. (I have simplified my code, to make my project easier to...
2
by: yxq | last post by:
Hello I want to create and delete the folder share, i found that it is ok for generic folder, but it does not work for Root directory(i.e c:\, d:\) The code...
0
by: troutbum | last post by:
I am listing the contents of a directory, everything seems to work fine. However, I created a share to the folder in the web for content management purposes. When any user opens the file in the...
7
by: Kejpa | last post by:
Hi, I'm logging the values my app is producing, in order to keep the logs small I zip them hourly. My problem lies in that two (or more) different objects discover that the hour has changed and...
2
by: Johnny Fugazzi | last post by:
I would like to access a network share from my vb.net application. I do not want to map a drive to the share, however. I would also like to specifiy a user credential to use when connecting to...
3
by: Brian Hampson | last post by:
I've swiped the following code pretty much directly from a technet article, and modified it for my purposes. Something isn't working. I'm trying to 1) create a share on a remote server...
5
by: =?Utf-8?B?QXlrdXQgRXJnaW4=?= | last post by:
Hi Willy, Thank you very much for your work. C++ code doesnot make any serialization. So at runtime C# code gives an serialization error at "msg_file_s sa = (msg_file_s) bf.Deserialize(ms);"...
6
by: Immortal Nephi | last post by:
First class is the base class. It has two data: m_Base1 and m_Base2. Second class and third class are derived classes and they are derived from first class. m_Base1 and m_Base2 are inherited into...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.