For Programmers: Free Programming Magazines  


Home > Archive > C > June 2006 > Where can I learn about Multithreading for C









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Where can I learn about Multithreading for C
bg_ie@yahoo.com

2006-06-26, 7:56 am

Hi,

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

Thanks,

Barry.

Nelu

2006-06-26, 6:56 pm

bg_ie@yahoo.com writes:

> 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

--
Ioan - Ciprian Tandau
tandau _at_ freeshell _dot_ org (hope it's not too late)
(... and that it still works...)
Tom St Denis

2006-06-26, 6:56 pm


b...@yahoo.com wrote:
> 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

Tom St Denis

2006-06-26, 6:56 pm


b...@yahoo.com wrote:
> 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

Nelu

2006-06-26, 6:56 pm

"Tom St Denis" <tomstdenis@gmail.com> writes:

> b...@yahoo.com wrote:
>
> 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.

--
Ioan - Ciprian Tandau
tandau _at_ freeshell _dot_ org (hope it's not too late)
(... and that it still works...)
bg_ie@yahoo.com

2006-06-26, 6:56 pm

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 s to 0x42a15b72

What might the problem be?

Thanks for your help,

Barry.


Nelu wrote:
> "Tom St Denis" <tomstdenis@gmail.com> writes:
>
>
> 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.
>
> --
> Ioan - Ciprian Tandau
> tandau _at_ freeshell _dot_ org (hope it's not too late)
> (... and that it still works...)


Tom St Denis

2006-06-26, 6:56 pm


b...@yahoo.com wrote:
> 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 s 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

Nelu

2006-06-26, 6:56 pm

bg_ie@yahoo.com writes:

>
> Nelu wrote:
[color=darkred]
> 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 s 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/mswins...nk1106ifodf.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.

--
Ioan - Ciprian Tandau
tandau _at_ freeshell _dot_ org (hope it's not too late)
(... and that it still works...)
Al Balmer

2006-06-26, 6:56 pm

On 26 Jun 2006 08:15:37 -0700, bg_ie@yahoo.com wrote:

>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 s 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.
>
>Thanks for your help,


--
Al Balmer
Sun City, AZ
P.J. Plauger

2006-06-26, 6:56 pm

<bg_ie@yahoo.com> wrote in message
news:1151334937.439132.62360@u72g2000cwu.googlegroups.com...

> 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 s 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


Keith Thompson

2006-06-26, 6:57 pm

"Tom St Denis" <tomstdenis@gmail.com> writes:
> b...@yahoo.com wrote:
>
> 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>

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Dann Corbit

2006-06-26, 6:57 pm

"Keith Thompson" <kst-u@mib.org> wrote in message
news:lnodwfu2cy.fsf@nuthaus.mib.org...
> "Tom St Denis" <tomstdenis@gmail.com> writes:
>
> <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).
</TOPICAL_WHAT_DOES_THAT_MEAN>

> --
> Keith Thompson (The_Other_Keith) kst-u@mib.org
> <http://www.ghoti.net/~kst>
> San Diego Supercomputer Center <*>
> <http://users.sdsc.edu/~kst>
> We must do something. This is something. Therefore, we must do this.



G4M3 C0D3R

2006-06-30, 6:56 pm

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

bg_ie@yahoo.com wrote:[color=darkred]
> 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 s to 0x42a15b72
>
> What might the problem be?
>
> Thanks for your help,
>
> Barry.
>
>
> Nelu wrote:

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com