Linux-Bulgaria.ORG
навигация

 

начало

пощенски списък

архив на групата

семинари ...

документи

как да ...

 

 

Предишно писмо Следващо писмо Предишно по тема Следващо по тема По Дата По тема (thread)

Re: lug-bg: Imam nujda ot... DONE.


  • Subject: Re: lug-bg: Imam nujda ot... DONE.
  • From: danchev@xxxxxxxxx (George Danchev)
  • Date: Mon, 19 Aug 2002 17:56:50 +0300



        Eh.... ami ponezhe sme po4nali neka dovyrshim nestata ;-)
Sega ako iskash da se zapoznaesh s originalnite cond_* functions 4eti docs na 
Solaris-a ... razgledaj header files i t.n. 

>   Az kakto kazah ne sym mnogo napred s Linux i neshta kato "double-boot
> Linux i Solaris x86" ili "kato na Linux dobavqsh
> i sources ot http://sctl.sourceforge.net/"-ot kyde gi dobaviam?

I ponezhe si se zapalil po Linux-a ... eto tova kak ste stane pod Linux, t.e. 
instalirane na library-to ScTL koeto ste se polzva ot Solaris threads 
applications  i map-va Solaris threads kym POSIX threads. Samo gledaj ( i ako 
iskash go iztestvaj;-). Vsi4ko e napraveno samo trebe da go vzemesh ... dori 
i example programa ima.

cd /usr/local/src/
mkdir SCTL-SOURCE
mkdir SCTL-BUILD
ln -s /usr/bin/make /usr/bin/gnumake
cd SCTL-SOURCE
wget ftp://download.sf.net/pub/sourceforge/sctl/sctl-1.0.1.src.tar.gz
tar xfvz sctl-1.0.1.src.tar.gz
export SCL_SOURCE_ROOT=/usr/local/src/SCTL-SOURCE
export SCL_BUILD_ROOT=/usr/local/src/SCTL-BUILD
cp common/solutils/src/mkdefs.out.backup    common/solutils/src/mkdefs.out
cp common/solutils/inc/scl_msg.h.backup      common/solutils/inc/scl_msg.h
tool/MakeSTL OS=lnx build
tool/MakeSTL OS=lnx install

dotuk pri men se compilira i instalira uspeshno. (v slu4aq s Debian 
GNU/Linux, no nqma zna4enie ... )
mahame symlink-a kym gnumake stoto e izlishen
rm -rf /usr/bin/gnumake

Demonstraciq na "Example program which uses Solaris thread API calls."
polzvashta cond_init(), cond_wait() i t.n. 

cd /usr/local/src/SCTL-BUILD/examples/threads
export LD_LIBRARY_PATH=/usr/local/src/SCTL-BUILD/shlib
./stl_example

Usage: ./stl_example number-of-threads
 -will create 5 new threads by default

New thread                 1026 running; argument is 1
New thread                 2051 running; argument is 2
New thread                 3076 running; argument is 3
New thread                 4101 running; argument is 4
New thread                 5126 running; argument is 5

main thread: all new threads running;
will release them in 2 seconds.

Thread                 2051 with argument 2 computed square = 4
Thread                 1026 with argument 1 computed square = 1
Thread                 4101 with argument 4 computed square = 16
Thread                 3076 with argument 3 computed square = 9
Thread                 5126 with argument 5 computed square = 25

All threads joined; total sum of squares is = 55

Kraj na free demonstraciqta ;-) 

> P.S. Za kakvo mi triabva tova li? Triabva da pisha neshto kato proekt za
> universiteta, kato celta mu e az da si napisha tezi spomenati funkcii  i
> da simuliram 3-4 nishki koito gi polzvat. Imam edna biblioteka koiato si
> ima vsichko za simuliraneto samo tezi funkcii se iska da napisha ot men.
> Ama za da gi napisha triabva pyrvo ot niakyde da vidia kakvo praviat,
> zashtoto opisanieto deto imam za tiah neshto ne mi vyrshi rabota! No
> pokrai tazi istoria se zapalih po Lunux-a i niama da ostavia tazi rabota
> tak nadiavam se! Az i predi sym bachkal ama malko samo! Tova e! Ako ima
> neshto...

ami spored men tova e idealniq primer kak applications s Solaris threads se 
map-vat kym pthreads (POSIX threads) i rabotqt pod Linux... Sled kato 
sviknesh kak da boravish byrzo i lesno s Linux-a (a to ne e koj znae kakvo) 
... mozhesh spokojno da se vyzpolzvash ot edin takyv template ... vizh code-a 
v SCTL-SOURCE direktoriqta i si napishi tvoi primerni podobni programi ... 

Az bih pokazal tova na tvoq professor v universite-ta i bih mu prepory4al da 
dump-i Solaris-a za Linux, stoto "Linux is the better solgier" ... 

DONE. Za pove4e ne moa ti pomogna braaaaaat  ... 

-- 
Greets, fr33zb1 
[catching up with Sid (the boy next door who destroyed toys :-)]
============================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers).
http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora
To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
============================================================================




 

наши приятели

 

линукс за българи
http://linux-bg.org

FSA-BG
http://fsa-bg.org

OpenFest
http://openfest.org

FreeBSD BG
http://bg-freebsd.org

KDE-BG
http://kde.fsa-bg.org/

Gnome-BG
http://gnome.cult.bg/

проект OpenFMI
http://openfmi.net

NetField Forum
http://netField.ludost.net/forum/

 

 

Linux-Bulgaria.ORG

Mailing list messages are © Copyright their authors.