Hi Simon,

About my test :
- principal input fact file is 220 000 line of 5 fields ( 7 389 Ko in Utf-8
on a windows pc)
- other files are 65 Ko
- initial and final data is on a 7200 rpm rotating disk,
- sqlite database(s), one per thread, is in ":memory:".

Threading Plumbery  is managed via DOS ".bat commands, as below :
- a "main.bat" dos command :
 . pre-clears the 4 "ok finished" files,
 . launch the 4 threads,
 . then check every 2 seconds that all "ok finished" files are generated.
- a "test_sqlite_this.bat" command launcher was necessary to pass
parameters for each sqlite session,



**main.bat** file
rem let's try parallel

cd %~dp0
set sqlite=%~dp0sqlite3.exe
echo %time%
@echo off

rem each thread is writing a "ok" file after it outputed its 1/4th of big
result

del /q "%~dp0zout_sqlite_v30_0ok.txt"
del /q "%~dp0zout_sqlite_v30_1ok.txt"
del /q "%~dp0zout_sqlite_v30_2ok.txt"
del /q "%~dp0zout_sqlite_v30_3ok.txt"
start cmd /C  "%~dp0test_sqlite_this.bat" %sqlite%
test_sqlite3_script_v30_0.txt  zout_sqlite_v30_0ok.txt debug
start cmd /C  "%~dp0test_sqlite_this.bat" %sqlite%
test_sqlite3_script_v30_1.txt  zout_sqlite_v30_1ok.txt nodebug
start cmd /C  "%~dp0test_sqlite_this.bat" %sqlite%
test_sqlite3_script_v30_2.txt  zout_sqlite_v30_2ok.txt nodebug
start cmd /C  "%~dp0test_sqlite_this.bat" %sqlite%
test_sqlite3_script_v30_3.txt  zout_sqlite_v30_3ok.txt nodebug

set zf="%~dp0zout_sqlite_v30_0ok.txt"

:step0
echo waiting %zf%
rem sleep 1
ping -n 2 127.0.0.1>nul

set zf="%~dp0zout_sqlite_v30_0ok.txt"
if not  exist %zf% goto step0

set zf="%~dp0zout_sqlite_v30_1ok.txt"
if not  exist %zf% goto step0

set zf="%~dp0zout_sqlite_v30_2ok.txt"
if not  exist %zf% goto step0

set zf="%~dp0zout_sqlite_v30_3ok.txt"
if not  exist %zf% goto step0

echo %time%
pause

** test_sqlite_this.bat** file
@echo off
rem %1=sqlite exec , %2=input file , %3=termination_file ,"%4"=="debug" (or
nothing)

cd %~dp0
echo %time%
echo "sqlite=%1"
echo "inputfile=%2"
echo "terminationfile=%3"
@echo on
%1 ":memory:"<%2

echo %time%>%3

if "%4"=="debug" pause
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to