小编Cod*_*Ars的帖子

我如何在struct中声明数组?

如何在其中声明具有固定大小数组的结构?

我找到了解决方案,但它只适用于原始数据类型.我需要我的阵列类型MyStruct.

那么如何在其中声明一个包含其他结构数组的结构?

恩.

    unsafe struct Struct1{
      fixed int arrayInt[100]; // works properly 
      fixed Struct2 arrayStruct[100]; //not compile
    }
Run Code Online (Sandbox Code Playgroud)

c# interop

7
推荐指数
2
解决办法
9678
查看次数

如何在新线程中强制执行

我的应用程序中有这样的代码:

var t = new Thread(new ThreadStart(new Action(SomeClass.SomeMethod)));
t.Start();
...
t.Join();
Run Code Online (Sandbox Code Playgroud)

但据我所知,编译器进行了一些优化,并在与主代码相同的线程中运行SomeMethod.我通过在t和Thread.CurrentThread中设置线程的不同名称来检查这一点.我如何创建和运行线程以确保它是新线程.

.net c# multithreading

2
推荐指数
1
解决办法
1586
查看次数

标签 统计

c# ×2

.net ×1

interop ×1

multithreading ×1