Re: [Mono-dev] Stop Garbage Collection for a Codeblock

2007-03-08 Thread Andreas Nahr
Using the fixed keyword you can prevent the collection of a memory block,
however I’m not sure this is what you’re looking for.

Also I fail to see how this (by itself) could possibly help with
time-critical parts.

 

Greetings

Andreas

 

  _  

Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von Back,
Michael (ext)
Gesendet: Donnerstag, 8. März 2007 10:06
An: mono-devel-list@lists.ximian.com
Betreff: [Mono-dev] Stop Garbage Collection for a Codeblock

 

Hi! 

Is it possible to stop the GC for garbage collecting for a code block? 
This would be helpful for time critical parts. 

I think about something like gc_barrierer_on and gc_barrierer_off. 

If such possibility doesn't exists, may be it could implemented and improve
mono :-) 

With best regards 
Michael Back 

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Stop Garbage Collection for a Codeblock

2007-03-08 Thread Back, Michael (ext)
Hi Andreas,
thanks for this hint - nice feature.
 
But we want that GC does nothing while a special code block ist executed!
 
Thanks
Michael



Von: Andreas Nahr [mailto:[EMAIL PROTECTED] 
Gesendet: Thursday, March 08, 2007 10:22 AM
An: Back, Michael (ext); mono-devel-list@lists.ximian.com
Betreff: AW: [Mono-dev] Stop Garbage Collection for a Codeblock



Using the fixed keyword you can prevent the collection of a memory block, 
however I'm not sure this is what you're looking for.

Also I fail to see how this (by itself) could possibly help with time-critical 
parts.

 

Greetings

Andreas

 



Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Back, Michael 
(ext)
Gesendet: Donnerstag, 8. März 2007 10:06
An: 

--=extPart_000_01D8_01C7616B.986Creff: [Mono-dev] Stop Garbage Collection 
for a Codeblock 

 

Hi! 

Is it possible to stop the GC for garbage collecting for a code block? 
This would be helpful for time critical parts. 

I think about something like gc_barrierer_on and gc_barrierer_off. 

If such possibility doesn't exists, may be it could implemented and improve 
mono :-) 

With best regards 
Michael Back 

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Stop Garbage Collection for a Codeblock

2007-03-08 Thread Jonathan Pryor
On Thu, 2007-03-08 at 10:05 +0100, Back, Michael (ext) wrote:
 Is it possible to stop the GC for garbage collecting for a code
 block? 

Simple (yet glib) answer: Don't allocate anything from the GC.  If you
don't allocate GC memory, then the GC won't get involved.  :-)

Sadly, this is the safest solution.  If you disable the GC and the GC
heap runs out of space, what should happen?  An OutOfMemoryException is
probably the only viable choice, which would likely be worse for you
than just having the GC intervene.

 - Jon


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Stop Garbage Collection for a Codeblock

2007-03-08 Thread Alan McGovern

Just my two cents,

The only reason i can think of where you'd require this kind of behaviour is
when you need real time processing and any kind of delay could be
disasterous. In this case, i wouldn't think C# would be a good choice to
implement in. What you could do is write a C program/library which does that
really special task and call it so that it will remain unaffected by the GC
and will do it's realtime processing in peace.

Hope that helps,
Alan


On 3/8/07, Jonathan Pryor [EMAIL PROTECTED] wrote:


On Thu, 2007-03-08 at 10:05 +0100, Back, Michael (ext) wrote:
 Is it possible to stop the GC for garbage collecting for a code
 block?

Simple (yet glib) answer: Don't allocate anything from the GC.  If you
don't allocate GC memory, then the GC won't get involved.  :-)

Sadly, this is the safest solution.  If you disable the GC and the GC
heap runs out of space, what should happen?  An OutOfMemoryException is
probably the only viable choice, which would likely be worse for you
than just having the GC intervene.

- Jon


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Stop Garbage Collection for a Codeblock

2007-03-08 Thread Leszek Ciesielski
AFAIK it is not possible to implement realtime applications in C#. Of
the managed languages, there's RealtimeJava (never used it) and Ada.
And both have to be run either on a specially modified Unix or on
their own micro-OS. Furthermore, I am not sure whether Ada allows GC
(opposed to explicit memory freeing) at all when run in RealTime mode.

This said, if all you require is really fast processing (not
http://en.wikipedia.org/wiki/Real-time_computing ), then pay close
attention what you feed to GC, this should be enough...

On 3/8/07, Alan McGovern [EMAIL PROTECTED] wrote:
 Just my two cents,

 The only reason i can think of where you'd require this kind of behaviour is
 when you need real time processing and any kind of delay could be
 disasterous. In this case, i wouldn't think C# would be a good choice to
 implement in. What you could do is write a C program/library which does that
 really special task and call it so that it will remain unaffected by the GC
 and will do it's realtime processing in peace.

 Hope that helps,
 Alan



 On 3/8/07, Jonathan Pryor [EMAIL PROTECTED] wrote:
  On Thu, 2007-03-08 at 10:05 +0100, Back, Michael (ext) wrote:
   Is it possible to stop the GC for garbage collecting for a code
   block?
 
  Simple (yet glib) answer: Don't allocate anything from the GC.  If you
  don't allocate GC memory, then the GC won't get involved.  :-)
 
  Sadly, this is the safest solution.  If you disable the GC and the GC
  heap runs out of space, what should happen?  An OutOfMemoryException is
  probably the only viable choice, which would likely be worse for you
  than just having the GC intervene.
 
  - Jon
 
 
  ___
  Mono-devel-list mailing list
  Mono-devel-list@lists.ximian.com
 
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
 


 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list




-- 
MS-DOS user since 5.0
Windows user since 3.11
Linux user since kernel 2.4
Novell Netware user since 2.2
WARCRAFT user since 1.0
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Stop Garbage Collection for a Codeblock

2007-03-08 Thread Paolo Molaro
On 03/08/07 Back, Michael (ext) wrote:
 Is it possible to stop the GC for garbage collecting for a code block?
 This would be helpful for time critical parts.
 
 I think about something like gc_barrierer_on and gc_barrierer_off.
 
 If such possibility doesn't exists, may be it could implemented and
 improve mono :-)

There is no API exposed in corlib that does that, though internally the
Boehm GC can do that: as the mono code is out there you could easily
expose the two needed internal calls. This may mean, though, that you
could get a nice OutOfMemory exception if the heap can't be expanded.
Make also sure you pre-jitted all the code needed.

lupus

-- 
-
[EMAIL PROTECTED] debian/rules
[EMAIL PROTECTED] Monkeys do it better
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Stop Garbage Collection for a Codeblock

2007-03-08 Thread Miguel de Icaza
hello,

 Is it possible to stop the GC for garbage collecting for a code
 block? 
 This would be helpful for time critical parts.

You would have to modify the GC to expose an API that prevents it
running, then you decide what the semantics should be, but be aware that
other threads will be running (like the finalizer).

Miguel
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list