Repository navigation
Next Generation - #6
Conversation
| print("Parsed and validated config file\nRendering...\n") | ||
|
|
||
| var fileWriteFinishers = 0 | ||
| let requiredFileWrites = data.deviceData.count * data.titles.count |
There was a problem hiding this comment.
Right, the dispatch group cannot wait on the main thread. However, I think what you could do is "block" the main thread with the run loop semaphore like you do now, then dispatch to a background queue, create the dispatch group there and then dispatch the individual tasks from there.
I think what you have now should work in most cases. However, I believe things like fileWriteFinishers += 1 are not atomic operations (it's executed as let tmp = fileWriteFinishers + 1; fileWriteFinishers = tmp) which means with multiple threads there's the potential for race conditions that lead to incorrect values. Dispatch groups and semaphore are generally made exactly to avoid such manual counting and the potential problems associated with it.
| print("Parsed and validated config file\nRendering...\n") | ||
|
|
||
| var fileWriteFinishers = 0 | ||
| let requiredFileWrites = data.deviceData.count * data.titles.count |
There was a problem hiding this comment.
Did you try moving the dispatch group to a background thread?
| @@ -0,0 +1,16 @@ | |||
| import Foundation | |||
There was a problem hiding this comment.
Femto-nit: I think these and others aren't really "mocks". They don't mock behavior. Instead it's just static data. Maybe "...Fixtures" would be a more correct file name though this is really nitpicky.
This is an almost complete rewrite of the tool which also changes some of its functionality.
Swiftframe now supports:
<b>Some bold text</b>).stringfiles, which are commonly used in iOS/macOS development. It enables the string lookup by key rather than index so that strings don't necessarily have to be in the same order across locales