Click or drag to resize

CONCURRENT-END Statement

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
CONCURRENT-END Statement

The CONCURRENT statement may be used to perform tasks concurrently in separate threads.

Caution note Caution

Alchemy waits for all statements within the CONCURRENT-END block to complete before execution starts on the following statement

Syntax

Alchemy
CONCURRENT
  [statement1]
  [statement2]
  [statement3]
END

Nomenclature

statementX A statement block or single statement to be executed concurrently with other statementXs.

Example

Suppose that a script contained the following code segment to build two large lookup tables:

Alchemy
CREATE LOOKUP areaById
  ON %area_name
  FROM "data\area"
  INDEX BY %id;

CREATE LOOKUP cityFromPostcode
  ON %city
  FROM "data\cities"
  INDEX BY %postcode;

If we were to run the code on a dual-CPU machine we could use the CONCURRENT statement to better leverage the capabilities of both CPUs by building the lookup tables in separate threads:

Alchemy
CONCURRENT

  BEGIN
    CREATE LOOKUP areaById
    ON %name
    FROM "data\area"
    INDEX BY %id;
  END

  BEGIN
    CREATE LOOKUP postCodes
    ON %suburb
    FROM "data\suburbs"
    INDEX BY %postcode;
  END

END
PRINT "Done!";
Note Note

Note that the PRINT statement is not executed until both LOOKUP statement blocks have completed and their threads have joined.