code: private void doParallel(final List list, final RestWriter parentWriter, final Set<Integer> visitedObjects, final Operation op) {
  
  		final SecurityContext securityContext = parentWriter.getSecurityContext();
  		final int numberOfPartitions          = (int)Math.rint(Math.log(list.size())) + 1;
  		final List<List> partitions           = ListUtils.partition(list, numberOfPartitions);
  		final List<Future<String>> futures    = new LinkedList<>();
  
  		for (final List partition : partitions) {
  
  			futures.add(threadPool.submit(() -> {
  
  				final StringWriter buffer = new StringWriter();
  
  				// avoid deadlocks by preventing writes in this transaction
  				securityContext.setReadOnlyTransaction();
  
  				try (final Tx tx = StructrApp.getInstance(securityContext).tx(false, false, false)) {
  
  					final RestWriter bufferingRestWriter = getRestWriter(securityContext, buffer);
  					final Set<Integer> nestedObjects     = new LinkedHashSet<>(visitedObjects);
  					configureWriter(bufferingRestWriter);
  
  					bufferingRestWriter.beginArray();
  
  					for (final Object o : partition) {
  
  						op.run(bufferingRestWriter, o, nestedObjects);
  					}
  
  					bufferingRestWriter.endArray();
  					bufferingRestWriter.flush();
  
  					tx.success();
  				}
  
  				final String data = buffer.toString();
  				final String sub  = data.substring(1, data.length() - 1);
  
  				return sub;
  
  			}));
  		}
  
  		for (final Iterator<Future<String>> it = futures.iterator(); it.hasNext();) {
  
  			try {
  
  				final Future<String> future = it.next();
  				final String raw            = future.get();
  
  				parentWriter.raw(raw);
  
  				if (it.hasNext()) {
  					parentWriter.raw(",");
  				}
  
  			} catch (Throwable t) {
  
  				t.printStackTrace();
  			}
  		}
  	}
docs: ----- private methods -----