private static AlignedData[] alignedData = new AlignedData[10];
private static MisalignedData[] misalignedData = new MisalignedData[10];

struct AlignedData {
	public byte B;
	public long L;
}

[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct MisalignedData {
	public byte B;
	public long L;
}

private static void WriterThreadEntry() {
	while (true) {
		alignedData[DATA_INDEX].L = -1L;
		misalignedData[DATA_INDEX].L = -1L;
		alignedData[DATA_INDEX].L = 1L;
		misalignedData[DATA_INDEX].L = 1L;
	}
}

private static void ReaderThreadEntry() {
	while (true) {
		var alignedValue = alignedData[DATA_INDEX].L;
		var misalignedValue = misalignedData[DATA_INDEX].L;
		if (alignedValue != 1L && alignedValue != -1L) {
			Console.WriteLine("Aligned value was torn! " + alignedValue);
		}
		if (misalignedValue != 1L && misalignedValue != -1L) {
			Console.WriteLine("Misaligned value was torn! " + misalignedValue);
		}
	}
}