Created
October 21, 2013 11:28
-
-
Save chiepomme/7082368 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using SpicyPixel.Threading; | |
using SpicyPixel.Threading.Tasks; | |
using System.Collections; | |
public class SampleConcurrency : ConcurrentBehaviour | |
{ | |
void Start() | |
{ | |
print("Start Start"); | |
taskFactory.StartNew(Bootstrap()) | |
.ContinueWith(Mikostrap(), taskScheduler); | |
print("Start End"); | |
} | |
IEnumerator Bootstrap() | |
{ | |
print("Start BootStrap"); | |
for (var i = 0; i < 100; i++) | |
{ | |
yield return i; | |
print("BootStrap"); | |
} | |
print("BootStrap End"); | |
} | |
IEnumerator Mikostrap() | |
{ | |
print("Start Mikopero"); | |
for (var i = 0; i < 100; i++) | |
{ | |
yield return i; | |
print("Mikopero"); | |
} | |
print("Mikopero End"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using UnityEngine; | |
public class SampleCoroutine : MonoBehaviour | |
{ | |
IEnumerator Start() | |
{ | |
print("Start Start"); | |
yield return StartCoroutine(Bootstrap()); | |
yield return StartCoroutine(Mikostrap()); | |
print("Start End"); | |
} | |
IEnumerator Bootstrap() | |
{ | |
print("Start BootStrap"); | |
for (var i = 0; i < 100; i++) | |
{ | |
yield return i; | |
print("BootStrap"); | |
} | |
print("BootStrap End"); | |
} | |
IEnumerator Mikostrap() | |
{ | |
print("Start Mikopero"); | |
for (var i = 0; i < 100; i++) | |
{ | |
yield return i; | |
print("Mikopero"); | |
} | |
print("Mikopero End"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment