Comments (2)
I found the following:
public class Test5 {
private static void worker(object o) {
System.Console.WriteLine("hello from worker");
}
static void begin() {
System.Console.WriteLine("start test");
System.Threading.Thread t = new System.Threading.Thread(worker);
t.Start();
t.Join(); // hangs in join
System.Console.WriteLine("end test");
}
static Test5() {
// no effect: System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(typeof (object).TypeHandle);
// no effect: begin();
System.Console.WriteLine("start test");
System.Threading.Thread t = new System.Threading.Thread(worker);
t.Start();
t.Join(); // hangs in join
System.Console.WriteLine("end test");
}
static void Main(string[] args) {
/*
System.Console.WriteLine("hello from Main");
System.Console.WriteLine("start test");
System.Threading.Thread t = new System.Threading.Thread(worker);
t.Start();
t.Join(); // works
System.Console.WriteLine("end test");
*/
}
}
This is a minimal C# application which is able to demonstrate the effect. Thread.Join() uses assumingly the same low-level function as bthread_wait(). If we call Join() in the static constructor the thread starts but doesn't run its body; so we aparently cannot use static constructors as the "begin" part of a module - the system doesn't seem to be working properly at this point.
from oberon.
Fixed with commit 18e7d0d; the issue was indeed related to the static constructor; apparently it is a bad idea to map Oberon module begin sections to static constructors; in the present case the thread system seems to be in an unknown state causing the strange observations. Since I moved module begin to a dedicated method called via import dependency chain NAppGUI threads work seamless with Mono.
The NAppGUI Fractals example now works fine on Linux and Windows when run from Mono. There is still an issue on macOS though; the NAppGUI app seems to hang in osmain just after window_show; will be traced in a separate issue.
from oberon.
Related Issues (20)
- OBX IDE under OpenBSD 7.0 HOT 2
- Invalid IL code exception HOT 17
- Out.String goes past 0x mark HOT 2
- LSL same as ASH HOT 11
- Wrong assembly for some array of record HOT 2
- UTF-8 compiler switch? HOT 6
- Building for aarch64 error HOT 4
- Error when compiling any Oberon code on Linux Mint HOT 6
- Further development of Oberon+ HOT 29
- Miss *.SO HOT 19
- Handling strings from external sources HOT 10
- PCALL / RAISE problem HOT 6
- Issues with Sqlite binding code HOT 5
- add to binaries to github releases section HOT 3
- Trying to compile a simple example HOT 4
- "Env" like module - access to shell environment variables? HOT 3
- Read from console HOT 5
- VSCode Integration HOT 4
- Runnig on Windows 10 and detecting Mono installation HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oberon.