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

Coroutines using GetCompressedStack?

Ken
Does anyone know if it's possible to use Thread.GetCompressedStack and Thread.SetCompressedStack as the basis for a coroutine
library? There doesn't seem to be a lot of documentation on these methods, although I seem to remember reading somewhere that they
are intended for internal .Net use and aren't really supposed to be used by applications.

Thanks,
Ken
Nov 16 '05 #1
2 1774

"Ken" <ec*****@skim.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Does anyone know if it's possible to use Thread.GetCompressedStack and
Thread.SetCompressedStack as the basis for a coroutine library? There
doesn't seem to be a lot of documentation on these methods, although I
seem to remember reading somewhere that they are intended for internal
.Net use and aren't really supposed to be used by applications.


It may be possible, but the framework has a security attribute on it that I
was never able to bypass. I'm no master of security but it certainly isn't
terribly happy about it, meaning such a library would be *very* security
fragile. If it is possible it may well not be a feasiable tool to use
anywhere.

*HOWEVER*, I think it could be possible to achieve psuedo-coroutines(look
and act liek them without full stack swapping) using techniques like those
used in C# for its iterators and anonymous methods. That is, writing
acompiler that generates state machines and uses non-stack based locals. I'm
just not sure how well that will work in the real world.
Nov 16 '05 #2
Ken,

The documentation for these in .NET 2.0 no longer states that they are
for internal use only. As a matter of fact, I believe because of the work
that was done to host the runtime in SQL server, support for fibers as
managed threads was added in.

Now, whether or not the Thread class uses fibers, I think that in
general, you would have to host the runtime to set that particular setting.
I'm not sure of the specifics, but I would poke around in the beta, as I
know significant changes have been made to the Thread object.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Ken" <ec*****@skim.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Does anyone know if it's possible to use Thread.GetCompressedStack and
Thread.SetCompressedStack as the basis for a coroutine library? There
doesn't seem to be a lot of documentation on these methods, although I
seem to remember reading somewhere that they are intended for internal
.Net use and aren't really supposed to be used by applications.

Thanks,
Ken

Nov 16 '05 #3

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

Similar topics

8
by: Timothy Fitz | last post by:
It seems to me that in python, generators are not truly coroutines. I do not understand why. What I see is that generators are used almost exclusively for generation of lists just-in-time. Side...
2
by: rawCoder | last post by:
Hi All, I have a *.cer file, a public key of some one and I want to encrypt some thing using this public key. Can someone point me to a sample code for Encrypting some file using...
1
by: Mike | last post by:
When trying to compile (using Visual Web Developer 2005 Express Beta; frameworkv2.0.50215 ) the source code below I get errors (listed below due to the use of ICallBackEventHandler. Ultimately I...
11
by: Deiter | last post by:
State Machines and Coroutines The other thread on goto: Lead me to want to ask... In the spirit of state machines and coroutines, This n00b to C would like to know if setjmp/longjmp are the only...
6
by: Marshall T. Vandegrift | last post by:
Hi, I'm trying to write a decorator which allows one to produce simple coroutines by just writing a function as a generator expression which re-receives it's arguments as a tuple from each...
3
by: rocco.rossi | last post by:
I would really like to know more about python 2.5's new generator characteristics that make them more powerful and analogous to coroutines. Is it possible for instance to employ them in situations...
0
by: Jean-Paul Calderone | last post by:
On Wed, 23 Apr 2008 07:17:46 -0700 (PDT), rocco.rossi@gmail.com wrote: They're not coroutines. The difference between generators in Python 2.4 and in Python 2.5 is that in Python 2.5, `yield´...
4
by: ig | last post by:
First off, I'm a python n00b, so feel free to comment on anything if I'm doing it "the wrong way." I'm building a discrete event simulation tool. I wanted to use coroutines. However, I want to know...
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: 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...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.