Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Concurrent bag ex
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Collections.Concurrent; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here ConcurrentBag<int> bag = new ConcurrentBag<int>(); bag.Add(42); bag.Add(21); int result; if(bag.TryTake(out result)) Console.WriteLine(result); if(bag.TryPeek(out result)) Console.WriteLine(result); } } }
run
|
edit
|
history
|
help
0
Download a .NET assembly, and execute a static, parameterless method.
Url Encode
30272 Ex if...
modified
temp_with_pow
First Program
A2Z Dice Roll
Linear search
ICollection<T>.Add(T) - Performance Test
Plt-D v.0.9.3.1