You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a feature that splits an array into arrays each not exceeding the given size. #7565
This method creates ArraySegment[object] instances for each partition rather than actually building new arrays thus avoiding a lot of copying.
Note that there are two ways to do partitioning:
Number of items in a partition
Total number of partitions.
Total number of partitions is arguably better for parallel execution since you can number your partitions to match the number of cores on your machine e.g. on a 4-core machine:
# count words in 'Way and Peace'
[System.IO.File]::ReadAllLines("WarAndPeace.txt").
PartitionData(4).
foreachparallel{
(-split$_).
Count}.
Sum()
mazzy (@mazzy-ax) Is this your scenario? Or do you have other things in mind? If so, please share.
if it is a LINQ/PLINQ then what about a Restricted and Constained langage?
I would like to have this basic feature in these modes too. not only for parallel jobs.
mazzy (@mazzy-ax) It's a PowerShell "extension method" (i.e. built-in and implemented in C#) that uses PLINQ for its implementation. Note however, that once you have Task support, it can also be implemented as a script method:
foreachparallel wouldn't be available in Restricted language but it might be there in Constrained language as long as we can ensure there are no security holes (e.g. language mode would have to propagate into Tasks created by PLINQ)..
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
Activity
BrucePay commentedon Aug 18, 2018
Oddly enough, I've been implementing just such a thing related to Task-based programming in PowerShell (see #6716):
This method creates
ArraySegment[object]instances for each partition rather than actually building new arrays thus avoiding a lot of copying.Note that there are two ways to do partitioning:
Total number of partitions is arguably better for parallel execution since you can number your partitions to match the number of cores on your machine e.g. on a 4-core machine:
mazzy (@mazzy-ax) Is this your scenario? Or do you have other things in mind? If so, please share.
mazzy-ax commentedon Aug 18, 2018
Bruce Payette (@BrucePay), yes, it's my scenario. And parallel processing too :)
is it implemented in Powershell or LINQ?
is it PLINQ?
if it is a LINQ/PLINQ then what about a Restricted and Constained langage?
I would like to have this basic feature in these modes too. not only for parallel jobs.
BrucePay commentedon Aug 19, 2018
mazzy (@mazzy-ax) It's a PowerShell "extension method" (i.e. built-in and implemented in C#) that uses PLINQ for its implementation. Note however, that once you have
Tasksupport, it can also be implemented as a script method:foreachparallelwouldn't be available in Restricted language but it might be there in Constrained language as long as we can ensure there are no security holes (e.g. language mode would have to propagate into Tasks created by PLINQ)..microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 23, 2023
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.