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
|
||||
let numberOfSamples: Int = 10
|
||||
|
||||
// FIXME: Probably here we have some pointer problems
|
||||
let rowPointer =
|
||||
UnsafeMutablePointer<UnsafeMutablePointer<Float>?>.allocate(capacity: numberOfSamples)
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ public actor IoTSimulatorCore {
|
||||
|
||||
// schedule work
|
||||
let task = IoTSimulatorCore.schedule(envID: environment.location, deviceID: device.deviceID) { msg in
|
||||
//print("\(msg.description)\n\n")
|
||||
print("\(msg.description)\n\n")
|
||||
} failure: {
|
||||
print("Something is wrong")
|
||||
}
|
||||
@ -67,7 +67,6 @@ public actor IoTSimulatorCore {
|
||||
let env = IoTSimulatorCore.getEnv(name: envID)!
|
||||
|
||||
while notCancelled {
|
||||
usleep(__useconds_t(dev.dutyCicle * 1000))
|
||||
|
||||
let message = dev.work(envrionment: env)
|
||||
do {
|
||||
@ -77,7 +76,7 @@ public actor IoTSimulatorCore {
|
||||
}
|
||||
|
||||
do {
|
||||
try Task.checkCancellation()
|
||||
try await Task.sleep(nanoseconds: UInt64(dev.dutyCicle) * UInt64(1E6))
|
||||
} catch {
|
||||
notCancelled = false
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ import Testing
|
||||
|
||||
@Test func stressLoop1() async throws {
|
||||
|
||||
let devices: Int = 1000
|
||||
let devices: Int = 5000
|
||||
|
||||
let env = PhysicalEnvironment("Delta")
|
||||
let truth = PhysicalData(.Temperature, 22)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user