The protection of resources

K

Krisztian Kepes

Hi !

In this time I use the Lock() for thread synchronization, and resource

protection.

But in the new project I must reorganize this thing.
The program must be run in lin/win, so I cannot use the winapi.

I need to protect resources from concurrent r/w.
Possible that the modules are not threads but are tasks.

In the Delphi and WinAPI I use the Mutex, that is a simple, opsystem
protected thing to signaling.
It is a simple signal (1/0).

I search for this in python, but I see only mutex with "procedure
queue".
I cannot see a signal like thing.
I want to only signaling: the resource are taken or not.
I don't want to wait for the non used state (not block !).

So these my questions:
- 1. How to use the py mutex object ? Please send an example to me !
- 2. Have the py an signal object ? (platform !!!)
- 3. Is any solution is a file locking. Have the py a possibility of
exclusive
file opening ?


Thx:
KK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top