469,609 Members | 1,376 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Question about mutexes

In OS/2 C, I would do this:

main()
{
....
DosCreateMutexSem(NULL, &hmtx, 0UL, FALSE);
....
}

thread()
{
....
DosRequestMutexSem(hmtx);

Locked!

DosReleaseMutexSem(hmtx);
....
}

How would I go about doing that in Python?

I figured this part out:

lockobj = mutex()

lockobj.lock(foo, "bar")

Locked!

lockobj.unlock()
Now, what (and more importantly: WHY?!) - is foo and "bar" for?

I have written a dummyfunction for foo which does nothing when
called, but I fail to see the point of its existence. Could someone
provide an example when this would be useful?
Jul 19 '05 #1
2 1374
Jan Danielsson wrote:
In OS/2 C, I would do this:

main()
{
...
DosCreateMutexSem(NULL, &hmtx, 0UL, FALSE);
...
}

thread()
{
...
DosRequestMutexSem(hmtx);

Locked!

DosReleaseMutexSem(hmtx);
...
}

How would I go about doing that in Python?


I think you will want to create a threading.Lock object.

Reinhold
Jul 19 '05 #2
Reinhold Birkenfeld wrote:
[---]
How would I go about doing that in Python?


I think you will want to create a threading.Lock object.


It would seem so. Thanks for the tip!
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Tim Rentsch | last post: by
7 posts views Thread by | last post: by
2 posts views Thread by QQ | last post: by
5 posts views Thread by Michael A. Covington | last post: by
17 posts views Thread by Arun Kumar | last post: by
2 posts views Thread by UJ | last post: by
7 posts views Thread by drawoh | last post: by
6 posts views Thread by John | last post: by
3 posts views Thread by pbd22 | last post: by
8 posts views Thread by Raxit | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.