Title: Variable in synchronized hashtable seems not thread-safe · Issue #13 · powercode/PSParallel · GitHub
Open Graph Title: Variable in synchronized hashtable seems not thread-safe · Issue #13 · powercode/PSParallel
X Title: Variable in synchronized hashtable seems not thread-safe · Issue #13 · powercode/PSParallel
Description: I have a variable: $syncHash.count, which is supposed to be thread-safe. But in this case, it's not: $collection | Invoke-Parallel -scriptblock { $syncHash.count ++ } I have to use mutex to protect it, in order to get correct count: $col...
Open Graph Description: I have a variable: $syncHash.count, which is supposed to be thread-safe. But in this case, it's not: $collection | Invoke-Parallel -scriptblock { $syncHash.count ++ } I have to use mutex to protect...
X Description: I have a variable: $syncHash.count, which is supposed to be thread-safe. But in this case, it's not: $collection | Invoke-Parallel -scriptblock { $syncHash.count ++ } I have to use mutex to pro...
Opengraph URL: https://github.com/powercode/PSParallel/issues/13
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Variable in synchronized hashtable seems not thread-safe","articleBody":"I have a variable: $syncHash.count, which is supposed to be thread-safe. But in this case, it's not:\r\n$collection | Invoke-Parallel -scriptblock {\r\n $syncHash.count ++\r\n}\r\nI have to use mutex to protect it, in order to get correct count:\r\n$collection | Invoke-Parallel -scriptblock {\r\n $syncHash.mutex.WaitOne()\r\n $syncHash.count ++\r\n $syncHash.mutex.ReleaseMutex()\r\n}\r\n\r\nIs this normal?","author":{"url":"https://github.com/MeCRO-DEV","@type":"Person","name":"MeCRO-DEV"},"datePublished":"2021-04-19T04:15:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/13/PSParallel/issues/13"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e19281c7-9e1f-110e-4d35-146cc8e32630 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A028:AADCD:14BEFAE:1C11628:696EA413 |
| html-safe-nonce | 12767013bcf6a8b7afed2899ceae8870a062d92fdf48cb9ec601128b030a2695 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDI4OkFBRENEOjE0QkVGQUU6MUMxMTYyODo2OTZFQTQxMyIsInZpc2l0b3JfaWQiOiIyNTM1NjA1MDY5NjIwODgwNDAzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0f2d8de045de61fff383a667c9a453a1cc3299c06e9db626bcc7357e886eca88 |
| hovercard-subject-tag | issue:860877932 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/powercode/PSParallel/13/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4c79b88f4f93d6f5a2c0f9f2c3ac6173b29d06d6d2a23a74cdc89033a67c2939/powercode/PSParallel/issues/13 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4c79b88f4f93d6f5a2c0f9f2c3ac6173b29d06d6d2a23a74cdc89033a67c2939/powercode/PSParallel/issues/13 |
| og:image:alt | I have a variable: $syncHash.count, which is supposed to be thread-safe. But in this case, it's not: $collection | Invoke-Parallel -scriptblock { $syncHash.count ++ } I have to use mutex to protect... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MeCRO-DEV |
| hostname | github.com |
| expected-hostname | github.com |
| None | fdad15fd2ad43212aa8b8be5f2c2725550f8374ceeeb154a999ad9145b43f3f7 |
| turbo-cache-control | no-preview |
| go-import | github.com/powercode/PSParallel git https://github.com/powercode/PSParallel.git |
| octolytics-dimension-user_id | 3505151 |
| octolytics-dimension-user_login | powercode |
| octolytics-dimension-repository_id | 46653749 |
| octolytics-dimension-repository_nwo | powercode/PSParallel |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 46653749 |
| octolytics-dimension-repository_network_root_nwo | powercode/PSParallel |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 27b23bc056eb973d350fc95afc848757edb9e7a9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width