system-calls

Is double close in strace necessarily bad?

Is double close in strace necessarily bad? Question: I am training a neural network. Somewhere in my code base, I have a code snippet like the following: def foo(): d = {} with PIL.Image.open(img_path) as img: d["img"] = torchvision.transforms.functional.to_tensor(img) return d This code doesn’t cause any problems. However, when I run my program under strace, …

Total answers: 1

futex() syscall timed out during python trying to connect remote oracle db

futex() syscall timed out during python trying to connect remote oracle db Question: I’m executing following python code to connect to remote DB server, I can see the syscalls getting timed out at the following location, so it take unusually high time to connect to the DB. How ever after like 10 seconds script connects …

Total answers: 1

Make syscall in Python

Make syscall in Python Question: I want to make syscall in Python and the function is not in libc, is there a way to do it in Python? More specifically, I want to call getdents, whose manpage says Note: There are no glibc wrappers for these system calls; All existing related solutions I found on …

Total answers: 1

Python: waiting for external launched process finish

Python: waiting for external launched process finish Question: The question already in title – how can one make the python script wait until some process launched with os.system() call is completed ? For example a code like for i in range( 0, n ): os.system( ‘someprog.exe %d’ % i ) This launches the requested process …

Total answers: 2