# RunByRef<T>(ref T)

> Performs the job's Execute method immediately on the main thread.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Jobs](/engine/6000.6/script-reference/unity/jobs.md)
* **Assembly:** UnityEngine.CoreModule

## RunByRef\<T>(T)

```csharp
public static void RunByRef<T>(this ref T jobData) where T : struct, IJob
```

### Parameters

**** (T): The job and data to run.

### Remarks

This variant passes the job struct by reference instead of by value, which can be faster than [IJobExtensions.Run](/engine/6000.6/script-reference/unity/jobs/ijobextensions/run.md) for larger job structs. Note that worker threads always operate on a local copy of the job struct.

While this method is useful in development or test environments, it is typically a mistake to use it in production; it offers no real benefits over implementing the job code as a simple main-thread function call. To schedule a job to run asynchronously, use [IJobExtensions.ScheduleByRef](/engine/6000.6/script-reference/unity/jobs/ijobextensions/schedulebyref.md).

Additional Resources: [IJob](/engine/6000.6/script-reference/unity/jobs/ijob.md).
