summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2015-02-20 12:29:44 +0000
committerhallgren <hallgren@chalmers.se>2015-02-20 12:29:44 +0000
commitf6cb6d172e3f43203ca256d9b8f746233ea15a4e (patch)
treec5dd3059f6bfa419cb2ba2c0d6a216fc2a43c13d /src/compiler
parente893d4139373e663af2955b68f54e8adb99ee845 (diff)
PGF Service: limit the number of parallel calls to the C run-time parse function to 4 by default
The limit can be changed with the -j flag
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/GF/Interactive.hs3
-rw-r--r--src/compiler/GF/Server.hs4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/GF/Interactive.hs b/src/compiler/GF/Interactive.hs
index b4a04658f..16495d9dd 100644
--- a/src/compiler/GF/Interactive.hs
+++ b/src/compiler/GF/Interactive.hs
@@ -71,11 +71,12 @@ shell opts files = loop opts =<< runSIO (importInEnv emptyGFEnv opts files)
-- | Run the GF Server (@gf -server@).
-- The 'Int' argument is the port number for the HTTP service.
mainServerGFI opts0 port files =
- server port root (execute1 opts)
+ server jobs port root (execute1 opts)
=<< runSIO (importInEnv emptyGFEnv opts files)
where
root = flag optDocumentRoot opts
opts = beQuiet opts0
+ jobs = join (flag optJobs opts)
#else
mainServerGFI opts files =
error "GF has not been compiled with server mode support"
diff --git a/src/compiler/GF/Server.hs b/src/compiler/GF/Server.hs
index 34a8c6e57..6036bfd38 100644
--- a/src/compiler/GF/Server.hs
+++ b/src/compiler/GF/Server.hs
@@ -56,10 +56,10 @@ import URLEncoding(decodeQuery)
debug s = logPutStrLn s
-- | Combined FastCGI and HTTP server
-server port optroot execute1 state0 =
+server jobs port optroot execute1 state0 =
do --stderrToFile logFile
state <- newMVar M.empty
- cache <- PS.newPGFCache
+ cache <- PS.newPGFCache jobs
datadir <- getDataDir
let root = maybe (datadir</>"www") id optroot
-- debug $ "document root="++root