newbie thread programming

B

Bo Sun

hi:

Suppose I have a C language program which is about thread programming.
This program works fine under Unix platform.

1) is there a tool that I can use to watch the running state of the
threads?

2) I want to run the same program using microsoft VC++. how can I modify
it? for example, thread.h cannot be found..

thanks,

bo
 
A

Alex

Bo Sun said:
Suppose I have a C language program which is about thread programming.
This program works fine under Unix platform.
1) is there a tool that I can use to watch the running state of the
threads?
2) I want to run the same program using microsoft VC++. how can I modify
it? for example, thread.h cannot be found..

None of your questions have anything to do with standard C.

For Unix programming: comp.unix.progammer
For Threads programming: comp.programming.threads
For Windows programming: comp.os.ms-windows.programmer.misc
comp.os.ms-windows.programmer.win32

Formulate multiple cohesive questions and post to those
groups in which they are appropriate.

Alex
 
C

Christopher Benson-Manica

Bo Sun said:
Suppose I have a C language program which is about thread programming.

As stated, there are groups where such programs are appropriate. This
isn't one of them.
2) I want to run the same program using microsoft VC++. how can I modify
it? for example, thread.h cannot be found..

It won't be at all the same - your program relies on a number of
Unix-specific system calls which will be unavailable using Microsoft's
products. Use Google before you harass the people on
comp.os-windows.programmer.* or, better yet, purchase some books.
 
C

Christopher Benson-Manica

Christopher Benson-Manica said:
comp.os-windows.programmer.* or, better yet, purchase some books.
comp.os.ms-windows.programmer.*

*sigh* Sorry.
 
R

Randy Howard

b0s6067 said:
Suppose I have a C language program which is about thread programming.
This program works fine under Unix platform.

Unfortunately, threads are not standardized in the ANSI or ISO C
standard documents. As such, they are sadly off-topic here.
comp.programming.threads is probably the best place to go for this
type of thing.
1) is there a tool that I can use to watch the running state of the
threads?

You want a thread-aware debugger. Good luck. Some OS's provide such,
but not many. A newsgroup to your particular UNIX platform (you didn't
say which) is probably your best bet for that.
2) I want to run the same program using microsoft VC++.

AFAIK, the only thread implementation commonly available on both
Microsoft and OS's and UNIX/Linux variants is POSIX pthreads. There
is an implementation for Windows, which piggybacks on the Windows-
specific thread model fairly well. However...
how can I modify it? for example, thread.h cannot be found..

POSIX threads typically use a header <pthread.h>. If your OS
doesn't provide it, then you have some other thread model, and you
may not be able to bridge the gap without writing your own code to
hide the implementation detail differences between your OS and
those used by Windows and/or PTHREADS.

Again, comp.programming.threads or a group specific to your
flavor of UNIX is probably your best bet for this.
 
E

EventHelix.com

1) is there a tool that I can use to watch the running state of the

On unix use ps to see the thread status. On windows use the task manager.

BTW, this is off-topic here.

Sandeep
 
K

Keith Thompson

On unix use ps to see the thread status. On windows use the task manager.

BTW, this is off-topic here.

As readers of a (Unix|Windows)-related newsgroup could tell you,
(ps|the task manager) deals with processes, not threads.
 
J

John L

Keith Thompson said:
As readers of a (Unix|Windows)-related newsgroup could tell you,
(ps|the task manager) deals with processes, not threads.

Except (a bit) on Solaris. This illustrates why the OP should go
to a platform-specific newsgroup.

John.
 

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

Forum statistics

Threads
474,125
Messages
2,570,748
Members
47,302
Latest member
MitziWragg

Latest Threads

Top