wip with mutex lock

Signed-off-by: Peter Staar <taa@zurich.ibm.com>
This commit is contained in:
Peter Staar
2025-07-09 10:26:29 +02:00
parent ca8a98d695
commit 59e57bdcba
2 changed files with 8 additions and 6 deletions
+3 -3
View File
@@ -101,7 +101,7 @@ async def async_process_files_from_queue(
file_queue: Queue, page_level: bool, loglevel: str, sync: bool
):
parser = DoclingPdfParser(loglevel="fatal")
parser = DoclingPdfParser(loglevel=loglevel)
overview = []
@@ -112,7 +112,7 @@ async def async_process_files_from_queue(
break
# logging.info(
print(f"Queue-size [{file_queue.qsize()}], Processing task: {task.file_name}")
print(f"Queue-size [{file_queue.qsize()}], Processing task (sync: {sync}): {task.file_name}")
try:
start_time = time.time()
@@ -153,7 +153,7 @@ async def async_process_files_from_queue(
# pages = await asyncio.gather(*page_tasks)
# pages = await asyncio.gather(page_tasks[0:4])
STEP = 2
STEP = 1
for i in range(0, len(page_tasks), STEP):
print(i)
sublist = page_tasks[i : i + STEP]
+5 -3
View File
@@ -329,12 +329,14 @@ namespace pdflib
{
std::lock_guard<std::mutex> lock(mtx);
json_pages[l] = page_decoder.get();
std::stringstream ss;
ss << "decoding page " << page_number;
ss << "decoding page: " << page_number;
timings[ss.str()] = page_timer.get_time();
LOG_S(INFO) << ss.str();
json_pages[l] = page_decoder.get();
timings[ss.str()] = page_timer.get_time();
}
}
else