flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 04 May 2013, 09:34
Doing what?
|
|||
![]() |
|
tthsqe 04 May 2013, 09:37
oh, I though it was clear from the code.
I am calling fasm from a 64 bit program and waiting for it to finish before opening the output file. Obviously, problems arise if fasm takes more than 0.3 seconds to compile... |
|||
![]() |
|
revolution 04 May 2013, 09:42
Sure there are much better ways. Probably not using the ShellExecute and instead use CreateProcess would be a start. That way you can wait on the handle and also get the exit code.
|
|||
![]() |
|
nmaps 05 May 2013, 20:26
Create a job or semaphore and have your process loop to check if it's finished (or WaitForObject).
|
|||
![]() |
|
typedef 07 May 2013, 04:24
Use CreateProcess and watch it. Since you have control over it.
![]() |
|||
![]() |
|
tthsqe 07 May 2013, 08:15
Thanks - I'm going to try CreateProcess.
![]() |
|||
![]() |
|
edfed 07 May 2013, 08:17
or maybe read the binary file attributes to see if it's date is not older than N seconds. lol
if CreateProcess can return fasm state, it should be the solution. |
|||
![]() |
|
Feryno 07 May 2013, 09:20
do it as revolution suggested
use the handle returned by CreateProcess and then you can call GetExitCodeProcess http://msdn.microsoft.com/library/windows/desktop/ms683189%28v=vs.85%29.aspx if the return value is STILL_ACTIVE you must call it later again - e.g. some timeout (as the posted Sleep) or NtYieldExecution (exported from ntdll.dll) |
|||
![]() |
|
AsmGuru62 07 May 2013, 14:59
It is better to use CreateProcess() on separate thread and just WaitForSingleObject() on the handle.
Otherwise it is a loop on main thread which polls for STILL_ACTIVE and loads the CPU. |
|||
![]() |
|
typedef 07 May 2013, 23:28
AsmGuru62 wrote: It is better to use CreateProcess() on separate thread and just WaitForSingleObject() on the handle. CreateEvent() / ResetEvent/ RaiseEvent on a separate thread would accomplish this. Besides, WaitForSingleObject is a blocking API ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.