473,396 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to use Mutex in C

Hi Friends,
I have made a client server application in which multiple
clients can interact with server. but when two or more clients get
connected at the same time then memory error occurs. So I think i have
to use some synchronization tecnique to get things working properly. i
thought of using mutex. Can anybody help me with some sample code as
how to use mutex in C under windows.

Nov 10 '06 #1
3 10389
In article <11**********************@i42g2000cwa.googlegroups .com>,
<dh*******@gmail.comwrote:
>how to use mutex in C under windows.
That's a question for a Windows programming newsgroup: comp.lang.c
only deals with that which can be programmed using standard C with
no OS extensions.
--
Programming is what happens while you're busy making other plans.
Nov 10 '06 #2
dh*******@gmail.com wrote:
Hi Friends,
I have made a client server application in which multiple
clients can interact with server. but when two or more clients get
connected at the same time then memory error occurs. So I think i have
to use some synchronization tecnique to get things working properly. i
thought of using mutex. Can anybody help me with some sample code as
how to use mutex in C under windows.
You asked pretty much the same question a couple of days ago and you'll
still get the same answers today!

--
Ian Collins.
Nov 10 '06 #3

dh*******@gmail.com wrote:
Hi Friends,
I have made a client server application in which multiple
clients can interact with server. but when two or more clients get
connected at the same time then memory error occurs. So I think i have
to use some synchronization tecnique to get things working properly. i
thought of using mutex. Can anybody help me with some sample code as
how to use mutex in C under windows.
Mutexes are part of threading, not part of the C language (which, I
think explicitly, does not understand threads). You'd do better to ask
in a threading newsgroup, or perhaps find a good online or printed
reference.

The principles are simple, but the details will depend on the threading
implementation.

Nov 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Srijit Kumar Bhadra | last post by:
Hello, Here is some sample code with pywin32 build 203 and ctypes 0.9.6. Best regards, /Srijit File: SharedMemCreate_Mutex_win32all.py # This application should be used with...
5
by: Ken Varn | last post by:
I have a named mutex object that is accessed by both an asp.net application and a Windows executable .net application. The Windows executable runs under the administrator logon, while the asp.net...
193
by: Michael B. | last post by:
I was just thinking about this, specifically wondering if there's any features that the C specification currently lacks, and which may be included in some future standardization. Of course, I...
4
by: TGOS | last post by:
I was thinking about it for a while, a mutex written in C and without disabling any interrupts. Is it possible? typdef struct mutex { unsigned int owner1; unsigend int owner2; } *mutex; ...
2
by: Martin Maat | last post by:
Hi. I want to use the same mutex in different classes (web pages in an ASP.NET application). In global.asax.cs, the class that starts up first, I create a Mutex like this: static private...
16
by: Ed Sutton | last post by:
I use a mutex to disallow starting a second application instance. This did not work in a release build until I made it static member of my MainForm class. In a debug build, first instance got...
2
by: tony.newsgrps | last post by:
Hi there, I'm trying to understand the impact of killing a process that owns a system mutex (used to ensure there is only 1 instance of my program running) Here is my code pretty much: try...
3
by: NaeiKinDus | last post by:
Hello, i'm trying to program a thread that would be locked (by a mutex) and that would only be unlocked once that a function (generating data) is done. The purpose is to generate data, and unlock...
11
by: Lamont Sanford | last post by:
Given an object of type Mutex, what method or property should be called to determine if it is currently owned? I could call WaitOne(0,false) -- and if the return value is false, I could deduce...
2
by: tshad | last post by:
I am running a program as a Windows service which works fine. I am using a Mutex to prevent multiple threads from from accessing my log text file at the same time. It works fine in the Service:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.