Concurrent Programming

Computer Systems in 2023 like the many years before rely upon multithreading and multiprocessing. Numbers Matter and Numbers are subject to obfuscation in sales.

A higher number in computing used to sale a product might not always, and many times does not always lead to better performance. Better performance is generally just in one area. Gains are less simplistic than one would like. A car that can move at 30mph is half as fast as a car that can move a 60mph. If you give either of those cars a bad document with incorrect data there will still be a problem.

Performance gains can be Powerful, performance gains and Throughput are far from guaranteed from being Powerful. Faster numbers that can’t be trusted can lead to less belief due diligence has been added. Due diligence more enabled does not always equal Trust more enabled.

Concurrent processing increases complexity. Has the potential to create extra conditions that were not always available before. Imagine you could drive 4 different cars at 60mph with the perfect four pieces of that document to the right people.

1/4 of that document might have errors. Delivered to the right people potential for 75% of the document delivered to others to be more enabling for Throughput. No guarantee as 75% might depend greatly on 25%.

Tools factor into ability for Software Programmers and Developers to be able to deliver performant, stable, multithreaded applications. Increased ability for Integrated Development Environments (IDE) like Eclipse, Xcode, Microsoft Visual Studio, Clion, and IntelliJ can make the process of verification and testing performance easier, or harder.

If performance is made harder to gauge there is more potential for claims being made about performance that do not deliver. Specifics matter greatly, and I for one am tired of seeing claimed performance in Engineering without delivered performance.

Zero to 60 with speed in a pinch that you can rely upon or takes too long and you get hit by the semi next to the on ramp? Speed can be very enabling at the right times. 30 minutes in front of a storm vs 5 minutes in front of a storm matters.

There are hard problems in Concurrency and Google limiting my YouTube account factors into losses of Comprehension for the World and Supercomputers that has high potential for filtering into losses in Throughput and Processing Speed for their own company.

Google seen as does not step on their toes, can be trusted with Multiprocessing of the future likely not true value added. Speed at which things are re-enabled factors into World Throughput.

Or lack there of. Wonder why your gaming rig doesn’t run with twice the FPS? Ask the Google CEOs why they shut off a Texan’s YouTube account.

Invest in Google Go when they are limiting? Swift might be more likely to lead to gains.

Double the price on all corporate deals for Google’s purchases until account reenabled? Reduced Throughput has potential to lead to Reduced Throughput?

Potentially some at the top trying to sink the ship

On another point Apple limiting access to installs to those that have money in their accounts kind of gives feeling of very bad deal. Kind of limits the effectiveness of Java. Companies that hold purchases hostage are not long term enablers of support.

Factors into Throughput.

Throughput of Faster Java.

May God enable faster throughput of Java for companies that actually protect their developers, that actually value throughput gains. Kind of built in that way. Fast Java that delivers, a more fair playing field that allows companies some flexibilities or companies that have your pipeline held hostage.

A system allowed to thrive while null costing value subtracted from lives in Texas.

Apple and Google Not held accountable high potential for the CEOs that originally created the problem to be replaced by corrupted power in the future. VP’s installing decision not potential for seeing their own writing on the wall in a couple years time?

Want to see real Throughput Gains in Concurrent Multiprocessing computing? Remove the oppression that leads to losses. War lags chip manufacturing. War can lead to gains does not equal those gains will always be for you.

Better to enable better Throughput in Advance.

Consumer protection seems like a joke in 2023.

Can writers learn something from multithreaded programming? Weaving separate subplots together over time to help facilitate Theme and Plot delivered? Four processing cores with different names? Different characters in the story that act and react differently to new developments of knowns and unknowns?

A faster result does not guarantee a correct result.

More CPU cores working on a problem does not guarantee a correct result.

More CPU cores working on a problem does not guarantee a faster result than less CPU cores working on a problem. Complexity can add value, is far from guaranteed to add value.

Chasing down complicated bugs with underfunded poorly inspired tools can lead to downtime at critical times. A vending machine that requires access to one bank or one that requires access to 4 different banks. Parallel processing can lead to faster, not guaranteed to faster delivery of life saving water and nutrients.

A passive aggressive system of power allowing to be amped is like someone with a remote control saying require their vending machine calls to take 4 times as long. A little delay can lead to feeling of all the more earned?

Power mistreating me today sets precedent for the world, for future generations about what is right and what is wrong. What the world can get away with and what it cannot.

Better tests can be highly enabling for Concurrency. What bugs are not factors into throughput for ability to track down nasty concurrency bugs that do not always present themselves. Greater confidence of what something is not factors into throughput for find what a bug is. Less bugs equals potential for Much Greater Throughput.

https://junit.org/junit5/

Not sure I like the open source testing framework tide so closely to a corporate profit system. Might need some further clarification.

https://gradle.org/

Maven has been reliable for me

https://maven.apache.org/

Google a major investor in Gradle and has been more than a limiter and enabler of Oppression

A system that delivers or a system that is leveraged by a corrupt authority matters

Test Framework highjacked reduces desire to want to invest in JUnit, potential for rolling own

Trust factors into adoption of technologies

Bigger corporations with greater leverage on smaller corporations with nothing to keep the bigger corporations in check

Building your own wheels can be greater than buying broken wheels from oppression

180 pages of lag time to get going with a testing framework? Potential for early divests.

Inflection, Reflection, Annotations, and Code Magic can be Powerful, can reduce the straightforwardness of an application. Straightforward matters for Emphasis and tracking down bugs? Yes

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.Tag;
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Tag("fast")
public @interface Fast {
}

Code excerpt from JUnit document. Doesn’t really Inspire write me for every method in the app. Non Null Time Costs can be increased that reduce ability to test? That reduce emphasis and clarity?

The following excerpt is a bit more promising

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.DisplayNameGeneration;
import org.junit.jupiter.api.DisplayNameGenerator;
import org.junit.jupiter.api.IndicativeSentencesGeneration;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
class DisplayNameGeneratorDemo {
  @Nested
  @DisplayNameGeneration(DisplayNameGenerator.ReplaceUnderscores.class)
  class A_year_is_not_supported {
  @Test
  void if_it_is_zero() {
  }
  @DisplayName("A negative value for year is not supported by the leap year
computation.")
  @ParameterizedTest(name = "For example, year {0} is not supported.")
  @ValueSource(ints = { -1, -4 })
  void if_it_is_negative(int year) {
  }
  }
  @Nested
  @IndicativeSentencesGeneration(separator = " -> ", generator =
DisplayNameGenerator.ReplaceUnderscores.class)
  class A_year_is_a_leap_year {
  @Test
  void if_it_is_divisible_by_4_but_not_by_100() {
  }
  @ParameterizedTest(name = "Year {0} is a leap year.")
  @ValueSource(ints = { 2016, 2020, 2048 })
  void if_it_is_one_of_the_following_years(int year) {
  }
  }
}

I think the idea is keep the metadata about the test close to the code though I think having it rely upon annotation processing has potential for non ideals. Changes dimensionality. Potential for the same document processed in more than one way.

Thoughts of fit for a single purpose

int add(a,b) {
     return a+b;
}

vs

int addOrSubtract(a,b, boolean subtract) {
     if (!subtract)
         return a+b;
     else
         return a-b;
}

Both methods able to add, though one method has potential to increase complexity. Complexity can be value added and somethings can be not valued added. Programmer calling addOrSubtract now has potential to set the boolean flag subtract incorrectly.

vs

int add(a,b) {
     return a+b;
}

vs

int subtract(a,b) {
         return a-b;
}

Both have potential for working the same way, simpler can enable faster comprehension. Faster comprehension can equal increased Throughput.

Add in multithreading, having one core adding a set of data and one core subtracting a set of data. Factor in debug lines and break points, knowing which thread is calling add and which one is calling subtract is now enabled by the debugger.

Reduced Surface area for what a method does can be a lot of power for enabling better testing that factors into more testable, more bugs reduced.

Small pieces testable factor into slightly bigger pieces that are testable that have potential for the larger system as a whole for being more testable and verifiable.

Complexity, what does it gain me, what does it cost me. Costs me, likely to cost others as well. Time protected and enabled, far from guaranteed.

Microservices can operate in similar ways.

If you have one set of documents that adds numbers.

And you have another set of documents that subtract numbers.

Creating one service for processing the add documents and creating another service for processing the subtract documents can be a lot of power.

Now the add service can be load balanced and scaled with hardware that is designed specially for adding and the subtract service can be load balanced and scaled with hardware that is designed specially for subtracting.

Also an important reminder that granularity of data matters. A processor required to call to a server every time it wants to add, and to another server every time it wants to subtract can lead to wasted time.

How long things take to process is being reduced continuously. If processing takes 100 milliseconds that used to take an hour. Calling a server for processing for the hour could free up computational resources. At 100 ms call to the server likely to be more costly than running the processing locally.

Further servers can be non ideally leveraged in way that decrease security and viability of data. Each Network call fully appreciated as something with potential for gain and something with potential for loss?

Future enabled can be powerful. Single purpose reusable tried and true method has potential for moving from server closer to client processing. 10 years forward the same processing done on those addition and subtraction documents now likely can be done in much less time on client hardware without increased cost via network calls.

Will those additions have been made in a way that can be enabled by the future, or dredged in complexity and strong coupling?

A testing framework is powerful, should be a core feature of a language. If it is not built into the language potential for leveraged in non ideal ways. The language itself could be leveraged in non ideal ways as well. Trying to increase more solid ground in software is useful. I realize software is far from ideal solid ground.

A method written as a circuit? This circuit adds. That is all this circuit does. I can rely upon it to add is power. Single purpose high throughput is power. What something does and what something does not do understood is power. Less ability to comprehend like invisible systems (High Voltage for one) makes working with systems tougher.

Imagine two mechanical machines. One with intricate magnets used and one without intricate magnets used. Grandfather clock with gears, vs Grandfather clock with multiple stages with magnets that change orbits on gears in ways not easy to fully comprehend?

A gear turns or a gear turns in relation to how a magnet on another gear turns?

More dependencies increases complexity and increased complexity does not always enable corporate throughput

Dependencies are a bit of a requirement in this world, able to work with them effectively not always simple

Working on a startup then a new company shows up on the scene potential for having to integrate their new service with your service dependent upon business and investor constraints.

Companies that can adapt swiftly have higher potential for being around long term.

Section 4 of following document highly valuable in my opinion https://www.baeldung.com/java-lambda-effectively-final-local-variables

From what I read on StackExchange the wrappers can also be useful since a class object reference can be final and still allow modification to its member data.

The following code is free to use, MIT License

package math;

import java.util.ArrayList;
import java.util.logging.Logger;

public class AdditionUtil {
	private static Logger logger = Logger.getLogger(AdditionUtil.class.getName());
	
	public static int sumListOfIntegers(ArrayList<Integer> list) {
		int sum=0;
		sum = list.stream().mapToInt(value -> value).sum();		
		return sum;
	}
	
	private static void testSumListOfIntegers() {
		int validValue = 10;
		
		ArrayList<Integer> listOfIntegers = new ArrayList<>();
		listOfIntegers.add(1);
		listOfIntegers.add(2);
		listOfIntegers.add(3);
		listOfIntegers.add(4);
		int computedSum = sumListOfIntegers(listOfIntegers);
		logger.info("Computed sum = "+computedSum+" for list "+listOfIntegers);
		if (validValue==computedSum) {
			logger.info("Test completed successfully");
		} else {
			logger.severe("Test failed");
		}
	}
	
	public static void main(String args[]) {
		testSumListOfIntegers();
	}
}

Simple code, thoughts on readability and lambdas, originally was going for

int sum=0;
list.forEach((value) -> {
    sum+=value;
});
return value;

This will not compile due to local variables required to be final

This convolutes the code in my opinion

	public static int sumListOfIntegers2(ArrayList<Integer> list) {
		logger.info("Running method with wrapper");
		var object = new Object() { int sum=0; };
		list.forEach((value) -> {
			object.sum+=value;
		});
		return object.sum;
	}	

Requirement to wrap local variables in wrapper classes can create divestment from using the forEach API

	public static int sumListOfIntegers3(ArrayList<Integer> list) {
		logger.info("Running method 3");
		
		int sum=0;
		for (int i=0; i<list.size(); i++) {
			sum+=list.get(i);
		}
		
		return sum;
	}	

Access to local variables can be reduced has potential for changing things likely in some ways that creates and advantage and some ways that creates problems as seen with the final keyword and the divestment due to inability to work on same data set as calling method easily.

Java does not ideally group Warnings, it would be nice to have a way to group the warnings about this variable or method is not used. Sometimes variables and methods are added as framework for future development, always being warned that extra words are in the document is not all amplification of those words used at a later date.

A problem differentiating, could be an error that the developer forgot to assign, or remove a variable that is not used. Could be an error, gets set to Warning. Future development set as a warning does not give a feeling of reassurance. Trust and Positive Spin factors into what is Emphasized.

Imagine an organization flagged as Definitely an Oppression Enabler

Or a company that does not let employees go home before 5 o’clock PM set to a potential Oppression Enabler

Stuck inside all day, not enough sun light, potential for considered as similar to Vampire? Walks like a Vampire, takes time like a Vampire, not classify as Vampire?

Categorize and Classify Work and looking at screens all day as less than all Sunroom in?

Nearly 40, do I feel like my Hard work as an Engineer in the world has been Rewarded? No

System that is long term disrespect for hard workers in has high potential for less than ideal throughput amped over time.

Added following to my pom.xml

  <dependencies>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>5.9.1</version>
        <scope>test</scope>
    </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>5.9.1</version>
        <scope>test</scope>
    </dependency>    
  </dependencies>

Still not finding the dependency.

https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit-platform.html

[[1;34mINFO[m] [1;31mBUILD FAILURE[m
[[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[[1;34mINFO[m] Total time:  1.469 s
[[1;34mINFO[m] Finished at: 2023-03-20T08:40:20-05:00
[[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[[1;31mERROR[m] Failed to execute goal [32morg.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile[m [1m(default-compile)[m on project [36mFileUtilityLibrary[m: [1;31mCompilation failure[m: Compilation failure: 
[[1;31mERROR[m] /C:/Users/jason/eclipse-workspace3/FileUtilityLibrary/src/module-info.java:[11,35] module not found: org.junit.jupiter.api
[[1;31mERROR[m] /C:/Users/jason/eclipse-workspace3/FileUtilityLibrary/src/module-info.java:[12,31] module not found: org.junit.jupiter.engine

Appears my dependency is there, would be nice to have a nicer way to easily see which dependencies are in the local repository locally

C:\Users\jason\.m2\repository\org\junit\jupiter\junit-jupiter-api\5.9.1

Removing <test> from my pom.xml allowed me to compile

  <dependencies>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>5.9.1</version>
    </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>5.9.1</version>
    </dependency>    
  </dependencies>

Trying to run test first time

java.lang.IllegalAccessError: class org.junit.platform.launcher.core.ServiceLoaderRegistry (in unnamed module @0x4cb2c100) cannot access class org.junit.platform.commons.logging.LoggerFactory (in module org.junit.platform.commons) because module org.junit.platform.commons does not export org.junit.platform.commons.logging to unnamed module @0x4cb2c100
	at org.junit.platform.launcher.core.ServiceLoaderRegistry.<clinit>(ServiceLoaderRegistry.java:27)
	at org.junit.platform.launcher.core.LauncherFactory.<clinit>(LauncherFactory.java:66)
	at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.<init>(JUnit5TestLoader.java:37)
	at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
	at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
	at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:306)
	at java.base/java.lang.Class.newInstance(Class.java:684)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createRawTestLoader(RemoteTestRunner.java:371)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createLoader(RemoteTestRunner.java:366)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.defaultInit(RemoteTestRunner.java:310)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.init(RemoteTestRunner.java:225)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)

With code (MIT License)

package math;

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.Test;

import testing.TestLogger;

import java.util.ArrayList;
import java.util.logging.Logger;

public class AdditionUtilTest {
	private static TestLogger logger = new TestLogger(Logger.getLogger(AdditionUtil.class.getName()));	
	
	@Test
	private static void testSumListOfIntegers() {
		int validValue = 10;
		
		ArrayList<Integer> listOfIntegers = new ArrayList<>();
		listOfIntegers.add(1);
		listOfIntegers.add(2);
		listOfIntegers.add(3);
		listOfIntegers.add(4);
		
		int computedSum = AdditionUtil.sumListOfIntegers1(listOfIntegers);		
		logger.info("Computed sum = "+computedSum+" for list "+listOfIntegers);
		if (validValue==computedSum) {
			logger.logSuccess("Test succeed for method 1");
		} else {
			logger.logFailure("Test failed for method 1");
		}
		
		computedSum = 0;
		computedSum = AdditionUtil.sumListOfIntegers2(listOfIntegers);		
		logger.info("Computed sum = "+computedSum+" for list "+listOfIntegers);
		if (validValue==computedSum) {
			logger.logSuccess("Test succeed for method 2");
		} else {
			logger.logFailure("Test failed for method 2");
		}
		
		computedSum = 0;
		computedSum = AdditionUtil.sumListOfIntegers3(listOfIntegers);		
		logger.info("Computed sum = "+computedSum+" for list "+listOfIntegers);
		if (validValue==computedSum) {
			logger.logSuccess("Test succeed for method 3");
		} else {
			logger.logFailure("Test failed for method 3");
		}		
	}
}

https://github.com/junit-team/junit5/issues/2147

How many esoteric hoops required to jump through to be able to utilize a testing framework limits bugs fixed

How many lost developer hours spent on errors related to JUnit? World Wide?

Versus if corporations had their own test frameworks they know can build and don’t shift without knowledge? Reliance and Dependence, specially for Testing frameworks more useful in a Peaceful Harmonized World.

World of Max Profit? Not All Peace and Harmony Amped

Maybe will try JUnit in 5 months? When JUnit worked great in 2015?

Oppressive leverage and reliance does not always amp ideally.

They depend on that can easily be turned into they can’t

Published by techinfodebug

Flex and Java Developer, Christian, Art, Music, Video, and Vlogging

Leave a comment