Where can I learn about Multithreading for C

B

bg_ie

Hi,

Where on the internet can I learn about Multithreading for C using
functions like WaitForSingleObject(), CreateThread(), CreateMutex()
etc, rather than pthreads.

Thanks,

Barry.
 
N

Nelu

Hi,

Where on the internet can I learn about Multithreading for C using
functions like WaitForSingleObject(), CreateThread(), CreateMutex()
etc, rather than pthreads.

This is off-topic here.

<ot>
Probably the MSDN. The pthreads interface is described in the POSIX
standard and they are available on multiple platforms including, I
believe, Windows. What you are interested in is part of the Win32 API
and available only under Windows.
</ot>

If you need more information try a group that's specialized in your
kind of requests:
comp.programming.threads
com.os.ms-windows.programmer.win32
 
T

Tom St Denis

Hi,

Where on the internet can I learn about Multithreading for C using
functions like WaitForSingleObject(), CreateThread(), CreateMutex()
etc, rather than pthreads.

Off topic for the group...

But you're doing yourself no sort of favour of "rather than pthreads".
Using Win32API calls only in your application is a surefire way to lock
yourself into Windows.

Even on Windows you can use Cygwin to emulate pthreads for you.

So stick with pthreads and do things properly.

Tom
 
T

Tom St Denis

Hi,

Where on the internet can I learn about Multithreading for C using
functions like WaitForSingleObject(), CreateThread(), CreateMutex()
etc, rather than pthreads.

Off topic for the group...

But you're doing yourself no sort of favour of "rather than pthreads".
Using Win32API calls only in your application is a surefire way to lock
yourself into Windows.

Even on Windows you can use Cygwin to emulate pthreads for you.

So stick with pthreads and do things properly.

Tom
 
N

Nelu

Tom St Denis said:
Off topic for the group...

But you're doing yourself no sort of favour of "rather than pthreads".
Using Win32API calls only in your application is a surefire way to lock
yourself into Windows.

Even on Windows you can use Cygwin to emulate pthreads for you.

So stick with pthreads and do things properly.

I think you can use pthreads for Windows (from RedHat) without needing
to download the entire cygwin. I've never tried it but
ftp://sources.redhat.com/pub/pthreads-win32
may be worth checking.
 
B

bg_ie

Hi again,

Sorry for being off topic.

I wanted to do it with pthreads but couldn't get it working. I'm
running Developer Studio 97, and I'm getting the following error when I
try to link pthreadVC2.lib (or pthreadVC1.lib) within my project.
Here's the error -

C:\Program Files\DevStudio\VC\LIB\pthreadVC2.lib : fatal error LNK1106:
invalid file or disk full: cannot seek to 0x42a15b72

What might the problem be?

Thanks for your help,

Barry.
 
T

Tom St Denis

Hi again,

Sorry for being off topic.

I wanted to do it with pthreads but couldn't get it working. I'm
running Developer Studio 97, and I'm getting the following error when I
try to link pthreadVC2.lib (or pthreadVC1.lib) within my project.
Here's the error -

C:\Program Files\DevStudio\VC\LIB\pthreadVC2.lib : fatal error LNK1106:
invalid file or disk full: cannot seek to 0x42a15b72

What might the problem be?

It means the file is invalid. Probably truncated or not a .lib at all.

If you had cygwin you could just do a

objdump -x pthreadVC2.lib

and see if it recognizes the format :)

.... hint ... get cygwin! Even if you use Visual Studio the shell tools
are very useful.

Tom
 
N

Nelu

Hi again,

Sorry for being off topic.

I wanted to do it with pthreads but couldn't get it working. I'm
running Developer Studio 97, and I'm getting the following error when I
try to link pthreadVC2.lib (or pthreadVC1.lib) within my project.
Here's the error -

C:\Program Files\DevStudio\VC\LIB\pthreadVC2.lib : fatal error LNK1106:
invalid file or disk full: cannot seek to 0x42a15b72

What might the problem be?

Thanks for your help,

Hi, again.
Please don't top-post. I fixed your follow-up.

I haven't used pthreads that much and I have never used them under
Windows. Others on this group may have done it but your best bet of
finding the right answer is to post your questions on the groups I
provided in an earlier reply.

From digging on the Internet:

http://www.cryer.co.uk/brian/mswinswdev/msdev_lnk1106ifodf.htm

As you can see, there may be a number of problems, none of them on-topic
here. You should be able to better advice on a newsgroup better suited
for this sort of things.
 
A

Al Balmer

Hi again,

Sorry for being off topic.

I wanted to do it with pthreads but couldn't get it working. I'm
running Developer Studio 97, and I'm getting the following error when I
try to link pthreadVC2.lib (or pthreadVC1.lib) within my project.
Here's the error -

C:\Program Files\DevStudio\VC\LIB\pthreadVC2.lib : fatal error LNK1106:
invalid file or disk full: cannot seek to 0x42a15b72

What might the problem be?

It's still off topic. You will get much better help on a newsgroup
where it is on topic.
 
P

P.J. Plauger

Hi again,

Sorry for being off topic.

I wanted to do it with pthreads but couldn't get it working. I'm
running Developer Studio 97, and I'm getting the following error when I
try to link pthreadVC2.lib (or pthreadVC1.lib) within my project.
Here's the error -

C:\Program Files\DevStudio\VC\LIB\pthreadVC2.lib : fatal error LNK1106:
invalid file or disk full: cannot seek to 0x42a15b72

What might the problem be?

If all else fails, you might find a commercial solution cheaper.
See the Compleat Library at our web site. It includes a threads
library that looks like a portable subset of pthreads and works
the same across Unix, Linux, and Windows. And it's part of a
bundle of libraries (including Standard C and C++) all packaged
to work together out of the box.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
 
K

Keith Thompson

Tom St Denis said:
Off topic for the group...

But you're doing yourself no sort of favour of "rather than pthreads".
Using Win32API calls only in your application is a surefire way to lock
yourself into Windows.

Even on Windows you can use Cygwin to emulate pthreads for you.

So stick with pthreads and do things properly.

<STILL_OFF_TOPIC>
Cygwin is a good thing (I'm using it right now), but if you write code
that depends on it, that code will run only on Windows systems that
have Cygwin installed. If you're planning to distribute your code,
avoiding that requirement would be a good idea. (Cygwin is easy to
install, but that doesn't mean everyone will be willing to install
it.)
</STILL_OFF_TOPIC>
 
D

Dann Corbit

Keith Thompson said:
<STILL_OFF_TOPIC>
Cygwin is a good thing (I'm using it right now), but if you write code
that depends on it, that code will run only on Windows systems that
have Cygwin installed. If you're planning to distribute your code,
avoiding that requirement would be a good idea. (Cygwin is easy to
install, but that doesn't mean everyone will be willing to install
it.)
</STILL_OFF_TOPIC>

<TOPICAL_WHAT_DOES_THAT_MEAN>
Mingw can do most of the things that Cygwin can and does not require a
runtime distrubution. Also, Cygwin is not freeware (but if you need fork()
on win32 and don't want to tangle with the partially implemented PW32, then
you're stuck with it).
 
G

G4M3 C0D3R

Hi,

This problem could possibly be due to the incompatible library file
meant for VC++ 6 and above. I beleive Microsoft had released a Service
Pack for Visual C++ 5.0 to address this issue.

Try compiling it with VC++ 6 and it should work.

Cheers,
Venkatesh.S.C
 

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

No members online now.

Forum statistics

Threads
474,181
Messages
2,570,970
Members
47,537
Latest member
BellCorone

Latest Threads

Top