|
-
March 13th, 2010, 06:23 AM
#1
Help on Multithreading in C
Hello friends.......I am new to this sort of programming aka Multithreading and I am involved in a project where I need to use multithreading to make my system perform several tasks parallely. So I need to know can we do multithreading in C. If yes then can somebody suggest me some tutorial that may help me. I shall be very thankful.
-
March 13th, 2010, 06:38 AM
#2
Re: Help on Multithreading in C
If you want using multithreading in Windows then have a look at:
_beginthread, _beginthreadex
_endthread, _endthreadex
Victor Nijegorodov
-
March 13th, 2010, 10:11 AM
#3
Re: Help on Multithreading in C
What kind of task are you trying to parallelize?
-
March 13th, 2010, 11:24 AM
#4
Re: Help on Multithreading in C
I am working on a project related to audio capturing and sending the data over the network to the server for processing. So the task is make the process multithreaded such that the system keeps on capturing the data and sending the captures data to the server. Can u help me in this regard ?
-
March 26th, 2010, 08:46 PM
#5
Re: Help on Multithreading in C
Well you have a lot of things going on.
you need a multi-threaded sockets to accomplish this.
You may need to use UDP to achieve the speeds you desire, although you would have to do some testing of your application. TCP has certain built in limits.
http://tangentsoft.net/wskfaq/exampl...ed-server.html
The TangentSoft site is good for examples on Windows. Are you using Linux or some other OS?
ahoodin
To keep the plot moving, that's why.

-
April 1st, 2010, 11:03 AM
#6
Re: Help on Multithreading in C
FYI: You are going to have huge latency problems. About 70ms to get it through the PC and then however long it takes to send it down the pipe to the client PC.
If you use the Windows MM API you cannot get better than about 180ms on a PC, if you use something like ASIO, you can get down to about 100ms (but remember ASIO only supports one soundcard), if you use DirectX you can get down to about 70ms.
There is a kernel mode sound API, but MS doesn't publish it and no one here has ever been able to get the API (I have been trying for about 10 years).
I did a small communications app and the latency varied between 140ms and 570ms over my local 1000base-T network with standard TCP sockets.
Skype and it's bretheren can get away with this because humans can communicate slower than PCs can.
-Erik
-
April 1st, 2010, 11:34 AM
#7
Re: Help on Multithreading in C
 Originally Posted by egawtry
Skype and it's bretheren can get away with this because humans can communicate slower than PCs can.
-Erik
Not to mention the fact that the sample rate for these is probably a lot lower then that of a CD. IIRC, POTS frequency range was something like 2000-6000Hz. Which is pretty much all Skype really needs to support.
Viggy
-
April 11th, 2010, 05:38 AM
#8
Re: Help on Multithreading in C
 Originally Posted by saviour2009
Hello friends.......I am new to this sort of programming aka Multithreading and I am involved in a project where I need to use multithreading to make my system perform several tasks parallely. So I need to know can we do multithreading in C. If yes then can somebody suggest me some tutorial that may help me. I shall be very thankful.
You can make use of POSIX Thread Programming which can work on both on Linux and Windows.
Appreciate others by rating good posts
"Only buy something that you'd be perfectly happy to hold if the market shut down for 10 years." - Warren Buffett
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|