Project Name File Name Usage Source Code Link
Symbiote when_requesting_agents_in_parallel.cs Enumerable .Repeat( typeof(DummyActor), requestsToMake ) .AsParallel() .ForAll( x => TestAgency.GetAgentFor() ) Link To Source File
Symbiote when_requesting_cached_actor.cs Enumerable .Range(0, 20) .AsParallel() .ForAll(x => Actor = Agent.GetActor("test")) Link To Source File
Symbiote when_requesting_same_actor_under_race_condition.cs Enumerable .Range( 0, 4 ) .AsParallel() .ForAll( x => Actor = Agent.GetActor( "test" ) ) Link To Source File
Symbiote when_requesting_stored_actor.cs Enumerable .Range(0, 20) .AsParallel() .ForAll(x => Actor = Agent.GetActor("test")) Link To Source File
Symbiote when_attempting_writes_in_parallel_to_exclusive_dictionary.cs Enumerable .Range( 1, 4 ) .Select( x => new ManualResetEvent( false ) ) .ToList() .AsParallel() .ForAll( x => { dictionary.ReadOrWrite( "key", () => ++accessCount ); } ) Link To Source File
Symbiote when_writing_in_parallel.cs targets .AsParallel() .ForAll( x => numbers .AsParallel() .ForAll( i => MailboxManager.Send( x, i ) ) ) Link To Source File
Symbiote when_writing_in_parallel.cs numbers .AsParallel() .ForAll( i => MailboxManager.Send( x, i ) ) Link To Source File
Symbiote when_doing_simple_math.cs Enumerable .Range(0, TOTAL_WRITES) .AsParallel() .ForAll(x => Buffer.Write(5)) Link To Source File
Symbiote when_sending_a_million_messages.cs Enumerable.Range( 0, 1000000 ).AsParallel().ForAll( x => bus.Publish( "local", new ThroughputMessage(), e => e.CorrelationId = ( x % 100 ).ToString() ) ) Link To Source File
Kinect TrackingViewModel.cs eventProperties.AsParallel().ForAll(pi => { PropertyInfo prop = thisType.GetProperty(pi.Name); if (prop != null && prop.CanWrite) { object propValue = pi.GetValue(e.Event, null); object newValue = propValue; if (pi.PropertyType == typeof (Point3D)) { newValue = ((Point3D) propValue); } prop.SetValue(this, newValue, null); } }) Link To Source File
Kinect UserViewModel.cs eventProperties.AsParallel().ForAll(pi => { PropertyInfo prop = thisType.GetProperty(pi.Name); if (prop != null && prop.CanWrite) { if (pi.PropertyType == typeof(Point3D)) { var propValue = pi.GetValue(e.Event, null); var point = (Point3D) propValue; var newValue = new Point3D(point.X * PropertionModifier, point.Y * PropertionModifier, point.Z * PropertionModifier); prop.SetValue(this, newValue, null); } } }) Link To Source File
Kinect EventPublisher.cs _pipelines.AsParallel().ForAll(p => p.Process(evt)) Link To Source File
Kinect Filter.cs _pipelines.AsParallel().ForAll(p => p.Process(evt)) Link To Source File
ILoveLucene ApplicationBootstrapper.cs Container .Resolve>() .AsParallel() .ForAll(t => { log.Info("Startup task {0} starting", t.GetType().FullName); t.Execute(); log.Info("Startup task {0} done", t.GetType().FullName); }) Link To Source File
Plywood Versions.cs listResponse.S3Objects.Where(obj => !ignorePaths.Any(ignore => obj.Key == String.Format("{0}{1}", prefix, ignore))) .AsParallel().ForAll(s3obj => { using (var getResponse = client.GetObject(new GetObjectRequest() { BucketName = Context.BucketName, Key = s3obj.Key, })) { getResponse.WriteResponseStreamToFile(Utils.Files.GetLocalAbsolutePath(s3obj.Key, prefix, directory.FullName)); } }) Link To Source File
Plywood Versions.cs files.AsParallel().ForAll(f => { string relativePath = Utils.Files.GetRelativePath(f.FullName, directory.FullName); // Skip dot (hidden) files. if (!relativePath.StartsWith(".")) { using (var putResponse = client.PutObject(new PutObjectRequest() { BucketName = Context.BucketName, Key = string.Format("{0}/{1}/{2}", STR_VERSIONS_CONTAINER_PATH, key.ToString("N"), relativePath), FilePath = f.FullName, GenerateMD5Digest = true, })) { } } }) Link To Source File
OpenSolar UriBitmapConverter.cs images.AsParallel() .OrderByDescending(x => x.Value.ReferenceCount) .ThenByDescending(_ => _.Value.LastReference) .Take(images.Count - MaxImages) .ForAll(x => images.Remove(x.Key)) Link To Source File
OpenSolar Client.cs categories.AsParallel() .ForAll(_ => { var total = 0; var lastup = _.LastUpdate; IList rt = null; Refreshing.DispatchEvent(this, new EventArgs(_)); lock (updateTimes) updateTimes[_] = 0; if (Settings.Default.Timeline.AutoResetNewCount) _.Unreads = 0; try { foreach (var i in this.Accounts.Reverse()) using (var client = new TwitterClient(i, this.StatusCache)) { if (!client.IsAuthorized) lock (this) Authenticate(this, new EventArgs(client.Authorization)); var sr = _.Statuses.OfType().Any() ? new StatusRange(sinceID: (_.Statuses.OfType().Where(__ => __.UserName != client.Account.Name).FirstOrDefault() ?? _.Statuses.OfType().FirstOrDefault()).StatusID, count: 200) : null; rt = _.Update(client, sr, ExceptSourceStreaming(i)); total += rt.Count; if (client.RateLimit.Account != null) { this.RateLimits.RemoveWhere(__ => __.Account == i); this.RateLimits.Add(client.RateLimit); } } } catch (Exception ex) { OnThrowWarning(_, ex); } finally { Refreshed.DispatchEvent(this, new EventArgs>(_, lastup == DateTime.MinValue ? new List() : rt)); } if (_.CheckUnreads && _.LastUpdate != DateTime.MinValue) if (Settings.Default.Timeline.AutoResetNewCount) _.Unreads = total; else _.Unreads += total; _.LastUpdate = DateTime.Now; }) Link To Source File
sbc OsterFarbrikService.cs _unbemalteEierObserver.AsParallel().ForAll((callback) => { if (_bwUnbemalteEier.CancellationPending) return; if (IsCommunicationOpened(callback)) { try { callback.NotifyUnbemaltesEiChanged(_unbemalteEier.Count); } catch (Exception ex) { Console.WriteLine(ex.ToString()); _unbemalteEierObserver.Remove(callback); } } else _unbemalteEierObserver.Remove(callback); }) Link To Source File
sbc OsterFarbrikService.cs _schokoHasenObserver.AsParallel().ForAll((callback) => { if (_bwSchokoHasen.CancellationPending) return; if (IsCommunicationOpened(callback)) { try { callback.NotifySchokoHaseChanged(_schokoHasen.Count); } catch (Exception ex) { Console.WriteLine(ex.ToString()); _schokoHasenObserver.Remove(callback); } } else _schokoHasenObserver.Remove(callback); }) Link To Source File
sbc OsterFarbrikService.cs _nesterObserver.AsParallel().ForAll((callback) => { if (_bwNester.CancellationPending) return; if (IsCommunicationOpened(callback)) { try { callback.NotifyNestChanged(_nester.Count); } catch (Exception ex) { Console.WriteLine(ex.ToString()); _nesterObserver.Remove(callback); } } else _nesterObserver.Remove(callback); }) Link To Source File
sbc OsterFarbrikService.cs _logistikObserver.AsParallel().ForAll((callback) => { if (_bwLogistik.CancellationPending) return; if (IsCommunicationOpened(callback)) { try { callback.NotifyLogistikChanged(_ausgeliefert.Count); } catch (Exception ex) { Console.WriteLine(ex.ToString()); _logistikObserver.Remove(callback); } } else _logistikObserver.Remove(callback); }) Link To Source File
sbc OsterFarbrikService.cs _bemalteEierObserver.AsParallel().ForAll((callback) => { if (_bwBemalteEier.CancellationPending) return; if (IsCommunicationOpened(callback)) { try { callback.NotifyBemaltesEiChanged(_bemalteEier.Count); } catch (Exception ex) { Console.WriteLine(ex.ToString()); _bemalteEierObserver.Remove(callback); } } else _bemalteEierObserver.Remove(callback); }) Link To Source File
Owl GeneticAlgorithm.cs parallelQuery.ForAll((e)=>e.GenerateLikelihood(fitnessSum)) Link To Source File
Owl GeneticAlgorithm.cs parallelQuery.ForAll(CalculateFitness) Link To Source File
folketsting TripScraper.cs rows.AsParallel().WithDegreeOfParallelism(parallelism).ForAll( _ => HandleRow(_)) Link To Source File
folketsting Scrape2009.cs rows.AsParallel().WithDegreeOfParallelism(_parallelism).ForAll( _ => GetLawChecked(_, samling, //"L 127", 2000, 1 null, null, null ) ) Link To Source File
WCFEvent ProductsService.cs subscribers.AsParallel().ForAll(callback => { if (((ICommunicationObject)callback).State == CommunicationState.Opened) { callback.OnPriceChanged(product); } else { subscribers.Remove(callback); } } ) Link To Source File
Presentations What.cs // or Enumerable .Range(0, 10) .AsParallel() .ForAll(ReallyComplexWork) Link To Source File
MiniTwitter-Mod TimelineExtension.cs timeline.Items.AsParallel().ForAll(item => { item.IsNewest = false; }) Link To Source File
MiniTwitter-Mod Entities.cs UserMentions.UserMention.AsParallel().ForAll(um => sb.AppendFormat("{0}-{1};ID {2};Name {3};Screen Name {4}/n", um.StartIndex, um.EndIndex, um.ID, um.Name, um.ScreenName)) Link To Source File
MiniTwitter-Mod Entities.cs Urls.URL.AsParallel().ForAll(url => sb.AppendFormat("{0}, At {1}, Is {2}", url.URL, url.DisplayUrl, url.ExpandedUrl)) Link To Source File
Mystique MouseAssignCore.cs infos .Where(i => i != null) .AsParallel() .ForAll(i => KernelService.MainWindowViewModel.InputBlockViewModel.AddUpdateWorker( new ViewModels.PartBlocks.InputBlock.TweetWorker( KernelService.MainWindowViewModel.InputBlockViewModel, i, body, inReplyToId, null, new string[0]))) Link To Source File
Inverse-Kinematics-ii AlgorithmTemplate.cs parentsList.AsParallel().ForAll(parents => { var child = DeepClone(parents[rand.Next(tournament)]); // jako podstawę wybieramy losowego rodzica foreach (var path in paths.OrderBy(p => p.Count())) // zaczynamy podstawianie od drzew najbliżej roota { var best = parents.OrderBy(p => p.Tree.Get(path).Score + p.Tree.Get(path).Error).ToList(); if (rand.NextDouble() < chance) // dziedziczenie wprost { child.Tree.AddSubtree(path, DeepClone(best.First().Tree).GetSubtree(path)); } else { Func f; var beta = 2 * rand.NextDouble() - 1; f = (n1, n2) => (n1.Angle + n2.Angle + beta * (n1.Angle - n2.Angle)) % 360; var tree = Tree.Map2(best[0].Tree.GetSubtree(path), best[rand.Next(tournament - 1) + 1].Tree.GetSubtree(path), f); var tree2 = Tree.Map2(child.Tree.GetSubtree(path), tree, (c, t) => new ChromosomeNode(t, c.Line)); child.Tree.AddSubtree(path, tree2); } } lock (children) { children.Add(child); } }) Link To Source File
Inverse-Kinematics-ii AlgorithmTemplate.cs parentsList.AsParallel().ForAll(parents => { var child1 = DeepClone(parents[rand.Next(tournament)]); // jako podstawę wybieramy losowego rodzica var child2 = DeepClone(child1); var beta = rand.NextDouble(); foreach (var path in paths.OrderBy(p => p.Count())) // zaczynamy podstawianie od drzew najbliżej roota { var best = parents.OrderBy(p => p.Tree.Get(path).Score + p.Tree.Get(path).Error).ToList(); Func f, g; f = (n1, n2) => (n1.Angle + n2.Angle + beta * (n1.Angle - n2.Angle)) % 360; g = (n1, n2) => (n1.Angle + n2.Angle + beta * (n2.Angle - n1.Angle)) % 360; var ftree = Tree.Map2(best[0].Tree.GetSubtree(path), best[rand.Next(tournament - 1) + 1].Tree.GetSubtree(path), f); var ftree2 = Tree.Map2(child1.Tree.GetSubtree(path), ftree, (c, t) => new ChromosomeNode(t, c.Line)); child1.Tree.AddSubtree(path, ftree2); var gtree = Tree.Map2(best[0].Tree.GetSubtree(path), best[rand.Next(tournament - 1) + 1].Tree.GetSubtree(path), g); var gtree2 = Tree.Map2(child1.Tree.GetSubtree(path), gtree, (c, t) => new ChromosomeNode(t, c.Line)); child2.Tree.AddSubtree(path, gtree2); } child1.recalculate(world.Specification.Spec); child2.recalculate(world.Specification.Spec); var child = child1.Tree.Node.Score < child2.Tree.Node.Score ? child1 : child2; lock (children) { children.Add(child); } }) Link To Source File
More Program.cs toCompile.AsParallel() .WithDegreeOfParallelism(maxParallelism) .WithExecutionMode(ParallelExecutionMode.ForceParallelism) .ForAll( delegate(string compile) { try { var threadContext = new Context(FileCache); contexts.Add(threadContext); var buffer = new StringBuilder(); var outputFile = OutputFileFor(compile, overwrite: overwrite); buffer.AppendLine("/t" + compile); buffer.Append("/tto " + outputFile); var timer = new Stopwatch(); timer.Start(); var result = Compile(workingDirectory, compile, threadContext, minify, warnAsErrors); timer.Stop(); if (result) { buffer.AppendLine(" in " + timer.ElapsedMilliseconds + "ms"); } else { buffer.AppendLine(" failed after " + timer.ElapsedMilliseconds + "ms"); } outMsg.Add(buffer.ToString()); } finally { @lock.Release(); } } ) Link To Source File
ZombieBrowser Browser.cs Process.GetProcessesByName("iexplore").ForAll(i => i.Kill()) Link To Source File
ZombieBrowser ElementTag.cs this.Children.Where(i => i is IElementTag).Cast() .ForAll(i => i.SetIndexed()) Link To Source File
ZombieBrowser ElementTag.cs this._children.ForAll(i => i.Dispose()) Link To Source File
MSTest MessageProcessorWithMsBlockingQueue.cs Enumerable.Range(0, threadsCount).AsParallel().WithDegreeOfParallelism(63).ForAll( el => toDispatch[el] = GetBlockingCollection(GetMessages(el))) Link To Source File
SwarmIntelligence PlinqExtensions.cs // Store all results into the collection source.ForAll(item => target.TryAdd(item)) Link To Source File
SwarmIntelligence LogJournal.cs onRecordsAddedChunkedDelegates .AsParallel() .ForAll(x => x(firstNewRecord, lastNewRecord)) Link To Source File
SwarmIntelligence LogJournal.cs onRecordsAddedDelegates .AsParallel() .ForAll(x => x(newRecords)) Link To Source File
NzbDrone MisnamedProvider.cs //Process the episodes misnamedFilesSelect.AsParallel().ForAll(f => { var episodes = f.Select(e => e).ToList(); var firstEpisode = episodes[0]; var properName = _mediaFileProvider.GetNewFilename(episodes, firstEpisode.Series.Title, firstEpisode.EpisodeFile.Quality, firstEpisode.EpisodeFile.Proper); var currentName = Path.GetFileNameWithoutExtension(firstEpisode.EpisodeFile.Path); if (properName != currentName) { misnamedFiles.Add(new MisnamedEpisodeModel { CurrentName = currentName, EpisodeFileId = firstEpisode.EpisodeFileId, ProperName = properName, SeriesId = firstEpisode.SeriesId, SeriesTitle = firstEpisode.Series.Title }); } }) Link To Source File
Experiments CompressedFileSearcher.cs m_spanMatches.AsParallel().ForAll(s => SearchSpan(s, toFind)) Link To Source File
csharputils LinqExExtensionsExt.cs Items.ForAll(action) Link To Source File
AgnesBot BaseModule.cs _handlers.AsParallel() .Where(handler => handler.Type == data.Type) .ForAll(handler => { var matches = handler.CommandRegex.Matches(data.Message); foreach (Match match in matches) ExecuteHandlerMethod(data, handler, match); }) Link To Source File
AgnesBot BotRunner.cs _modules.AsParallel() .ForAll(module => module.Process(data)) Link To Source File
WowPacketParser Program.cs packets.AsParallel().SetCulture().ForAll(packet => Handler.Parse(packet, headersOnly)) Link To Source File
WowPacketParser Program.cs packets.AsParallel().SetCulture().WithDegreeOfParallelism(Settings.Threads).ForAll(packet => Handler.Parse(packet, headersOnly)) Link To Source File
WowPacketParser Program.cs files.AsParallel().SetCulture() .ForAll(file => ReadFile(file, storage, builder, "[" + (++count).ToString(CultureInfo.InvariantCulture) + "/" + files.Length + " " + file + "]")) Link To Source File
WowPacketParser Program.cs files.AsParallel().SetCulture().WithDegreeOfParallelism(Settings.Threads) .ForAll(file => ReadFile(file, storage, builder, "[" + (++count).ToString(CultureInfo.InvariantCulture) + "/" + files.Length + " " + file + "]")) Link To Source File
WCell ParallelLinqExtensions.cs // Store all results into the collection source.ForAll(item => target.TryAdd(item)) Link To Source File