[C#]是否可以在其他进程中运行单个函数? [英] [C#] Is it possible to make a single function run in an other process?

查看:123
本文介绍了[C#]是否可以在其他进程中运行单个函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所说!我可以强制一个方法/函数在其他进程上运行而不会过多地进入程序集/反编译等吗?



我有一个应用程序在需要使用GDI +对一些图形对象进行一些非常繁重的内存工作(高达½-1 GB)所以我想让它在一个进程中单独运行,因为我在我的应用程序中运行时不断出现内存异常s主要过程。我试图分配更多的内存,但它似乎没有用,并试图使用GC.Collect(2);这对于完成工作的方法有一点帮助但不够。



简单的代码和手指点将是最受欢迎的! - 谢谢

As the title says! can I force a method/function to run on an other process without going too much into assemblies/decompiling etc.?

I''m having a app that is in need of doing some very heavy memory work with some graphic objects using GDI+, (up to ½-1 GB) so I want to have this to run in a process alone since I keep getting out of memory exceptions when running in my app''s "main" process. I''ve tried to play around with allocating more memory but it doesn''t seems to work, and also tried to use GC.Collect(2); which helped a little but not enough for the method to complete the work wished.

Simple code and finger points would be most appreciated!!! - Thanks

推荐答案

没有强制这样的东西来运行在单个进程上运行。流程完全在您的控制之下。如果你不创造一个过程,它本身不是由任何东西创造的。不建议使用GC。



你的没有太多的装配和类似的东西声音要求和傲慢,抱歉。你应该在.NET中开发,其中程序集是一个核心对象和概念。看起来你不明白这里的事物的本质。要获得更多帮助,您需要更加具体并分享您的最终目标。只有这样,即使你的方向错误,你也可以获得宝贵的建议。



-SA
There is no such thing as "force" to run something to "run on a single process". Processes are totally under your control. If you don''t create a process, it is not created by anything by itself. And using GC is not recommended.

Your "without going too much into assemblies and stuff like that" sound demanding and arrogant, sorry. You are supposedly developing in .NET, where the assembly is a central object and notion. It looks like you do not understand the essence of things here. To get more help, you need to be more specific and share your ultimate goal. Only then you can get valuable advice even if you are going in wrong direction.

—SA


这篇关于[C#]是否可以在其他进程中运行单个函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆