> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.reactor.server/ks.reactor.server.ksthreading.md).

# Class ksThreading

Namespace: [KS.Reactor.Server](/reactor/api-reference/ks.reactor.server.md)\
Assembly: KSReactor.dll

Utility for checking if the current thread is the main thread.

```csharp
public static class ksThreading
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [ksThreading](/reactor/api-reference/ks.reactor.server/ks.reactor.server.ksthreading.md)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Properties

### IsMainThread <a href="#ks_reactor_server_ksthreading_ismainthread" id="ks_reactor_server_ksthreading_ismainthread"></a>

Is the current thread the main thread?

```csharp
public static bool IsMainThread { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### RunningParallelScripts <a href="#ks_reactor_server_ksthreading_runningparallelscripts" id="ks_reactor_server_ksthreading_runningparallelscripts"></a>

Are user scripts currently running in parallel?

```csharp
public static bool RunningParallelScripts { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### PostRunParallelScripts <a href="#ks_reactor_server_ksthreading_postrunparallelscripts" id="ks_reactor_server_ksthreading_postrunparallelscripts"></a>

Invoked after running parallel scripts.

```csharp
public static event Action PostRunParallelScripts
```

#### Event Type

[Action](https://learn.microsoft.com/dotnet/api/system.action)

### PreRunParallelScripts <a href="#ks_reactor_server_ksthreading_prerunparallelscripts" id="ks_reactor_server_ksthreading_prerunparallelscripts"></a>

Invoked before running parallel scripts.

```csharp
public static event Action PreRunParallelScripts
```

#### Event Type

[Action](https://learn.microsoft.com/dotnet/api/system.action)
