V0.6.1 Arroyo Toad
Fixed MultiThread support, now supporting 1K devices
This commit is contained in:
parent
0c294045dc
commit
6940ad2b06
@ -51,6 +51,7 @@ public class EdgeDevice: EdgeDeviceP {
|
|||||||
// UGLY: Declaring here some variables manually, remove them if you want to offere flexibility
|
// UGLY: Declaring here some variables manually, remove them if you want to offere flexibility
|
||||||
let numberOfSamples: Int = 10
|
let numberOfSamples: Int = 10
|
||||||
|
|
||||||
|
// FIXME: Probably here we have some pointer problems
|
||||||
let rowPointer =
|
let rowPointer =
|
||||||
UnsafeMutablePointer<UnsafeMutablePointer<Float>?>.allocate(capacity: numberOfSamples)
|
UnsafeMutablePointer<UnsafeMutablePointer<Float>?>.allocate(capacity: numberOfSamples)
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ public actor IoTSimulatorCore {
|
|||||||
|
|
||||||
// schedule work
|
// schedule work
|
||||||
let task = IoTSimulatorCore.schedule(envID: environment.location, deviceID: device.deviceID) { msg in
|
let task = IoTSimulatorCore.schedule(envID: environment.location, deviceID: device.deviceID) { msg in
|
||||||
//print("\(msg.description)\n\n")
|
print("\(msg.description)\n\n")
|
||||||
} failure: {
|
} failure: {
|
||||||
print("Something is wrong")
|
print("Something is wrong")
|
||||||
}
|
}
|
||||||
@ -67,7 +67,6 @@ public actor IoTSimulatorCore {
|
|||||||
let env = IoTSimulatorCore.getEnv(name: envID)!
|
let env = IoTSimulatorCore.getEnv(name: envID)!
|
||||||
|
|
||||||
while notCancelled {
|
while notCancelled {
|
||||||
usleep(__useconds_t(dev.dutyCicle * 1000))
|
|
||||||
|
|
||||||
let message = dev.work(envrionment: env)
|
let message = dev.work(envrionment: env)
|
||||||
do {
|
do {
|
||||||
@ -77,7 +76,7 @@ public actor IoTSimulatorCore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
try Task.checkCancellation()
|
try await Task.sleep(nanoseconds: UInt64(dev.dutyCicle) * UInt64(1E6))
|
||||||
} catch {
|
} catch {
|
||||||
notCancelled = false
|
notCancelled = false
|
||||||
|
|
||||||
|
|||||||
@ -66,7 +66,7 @@ import Testing
|
|||||||
|
|
||||||
@Test func stressLoop1() async throws {
|
@Test func stressLoop1() async throws {
|
||||||
|
|
||||||
let devices: Int = 1000
|
let devices: Int = 5000
|
||||||
|
|
||||||
let env = PhysicalEnvironment("Delta")
|
let env = PhysicalEnvironment("Delta")
|
||||||
let truth = PhysicalData(.Temperature, 22)
|
let truth = PhysicalData(.Temperature, 22)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user