Monday, November 28, 2005

Solaris Multithreading

Почитал тут http://www.sun.com/software/whitepapers/solaris9/multithread.pdf .
Неоднозначное впечатление. Крайне неоднозначное. Читая Соломон, Руссинович "Windows 2000 Internal",
как-то всё гладко и пушисто, а тут... с 2.1 до 2.9, да в каждой версии всё по новому, да и ладно б понемногу,
так ведь изменения достаточно кардинальны.

Вывод? Надо ещё почитать.

А для чего это мне?

В WinNT есть mutex и critical section. Разница "пишущим" известна. Хочу посмотреть, что в Solaris ближе всего
к понятию critical section, точнее сказать, как максимально "разогнать" использование mutex'а, зная некоторые
факты о "своей" софтине.

Эх, жаль, что не получилось попасть, зажгли старички

http://www.gazeta.ru/2005/11/28/oa_179474.shtml

Белорусская ОС - интервью

Оказывается, это не совсем шутка.
http://www.livejournal.com/users/sir_mojo/114336.html

О рейтинге

Россия – последняя в ряду из тридцати семи стран, исследованных аналитиками Datamonitor на предмет зрелости рынка IT-услуг.

Win->Lin

via кто-то из френдов

http://www.msmobilenews.com/uploads/2005/11/winux.swf

Wednesday, November 23, 2005

Простенькая программка: #include <stdio...

Простенькая программка:




#include <stdio.h>

#include <pthread.h>

#include <time.h>



int MTXTYPE;



int rv;



void printresult(const char* what)

{

printf("%s: %d\n", what, rv);

}



int main(void)

{

#ifdef MTXRECURSIVE

MTXTYPE = PTHREAD_MUTEX_RECURSIVE;

#elif defined MTXERRCHECK

MTXTYPE = PTHREAD_MUTEX_ERRORCHECK;

#else

----- THIS WILL CAUSE ERROR -----

#endif

printf("mutex type: %d\n", MTXTYPE );



pthread_mutex_t mtx;

pthread_mutexattr_t attr;



rv = pthread_mutexattr_init(&attr);

printresult("pthread_mutexattr_init");

rv = pthread_mutexattr_settype(&attr, MTXTYPE);

printresult("pthread_mutexattr_settype");

rv = pthread_mutex_init(&mtx, &attr);

printresult("pthread_mutex_init");



rv = pthread_mutex_lock(&mtx);

printresult("pthread_mutex_lock");

rv = pthread_mutex_trylock(&mtx);

printresult("pthread_mutex_trylock");

rv = pthread_mutex_lock(&mtx);

printresult("pthread_mutex_lock");





rv = pthread_mutex_unlock(&mtx);

printresult("pthread_mutex_unlock");

rv = pthread_mutex_destroy(&mtx);

printresult("pthread_mutex_destroy");

rv = pthread_mutexattr_destroy(&attr);

printresult("pthread_mutexattr_destroy");



return 0;

}





Компилирую на двух машинах:

Первая:

[rezndmi@goldtpus17 /home/rezndmi/test/pthread] uname -a

SunOS goldtpus17 5.8 Generic_117350-25 sun4u sparc SUNW,Netra-T12




Вторая:

[rezndmi@goldtpus22 /home/rezndmi/tests]$ uname -a

Linux goldtpus22 2.4.21-251-smp #1 SMP Thu Sep 23 17:22:54 UTC 2004 i686 unknown

(для второй меняю PTHREAD_MUTEX_XXX на PTHREAD_MUTEX_XXX_NP , что тоже самое, что по хидеру, что по логике)




На первой машине:

[rezndmi@goldtpus17 /home/rezndmi/test/pthread] CC -DMTXRECURSIVE pt1.c -o mtxrec

[rezndmi@goldtpus17 /home/rezndmi/test/pthread] CC -DMTXERRCHECK pt1.c -o errchk

[rezndmi@goldtpus17 /home/rezndmi/test/pthread] ./mtxrec

mutex type: 4

pthread_mutexattr_init: 0

pthread_mutexattr_settype: 0

pthread_mutex_init: 0

pthread_mutex_lock: 0

pthread_mutex_trylock: 0

pthread_mutex_lock: 0

pthread_mutex_unlock: 0

pthread_mutex_destroy: 0

pthread_mutexattr_destroy: 0

[rezndmi@goldtpus17 /home/rezndmi/test/pthread] ./errchk

mutex type: 2

pthread_mutexattr_init: 0

pthread_mutexattr_settype: 0

pthread_mutex_init: 0

pthread_mutex_lock: 0

pthread_mutex_trylock: 0

pthread_mutex_lock: 0

pthread_mutex_unlock: 0

pthread_mutex_destroy: 0

pthread_mutexattr_destroy: 0




На второй машине:

[rezndmi@goldtpus22 /home/rezndmi/tests]$ ./lmtxrec

mutex type: 1

pthread_mutexattr_init: 0

pthread_mutexattr_settype: 0

pthread_mutex_init: 0

pthread_mutex_lock: 0

pthread_mutex_trylock: 0

pthread_mutex_lock: 0

pthread_mutex_unlock: 0

pthread_mutex_destroy: 16

pthread_mutexattr_destroy: 0

[rezndmi@goldtpus22 /home/rezndmi/tests]$ ./lmtxerr

mutex type: 2

pthread_mutexattr_init: 0

pthread_mutexattr_settype: 0

pthread_mutex_init: 0

pthread_mutex_lock: 0

pthread_mutex_trylock: 16

pthread_mutex_lock: 35

pthread_mutex_unlock: 0

pthread_mutex_destroy: 0

pthread_mutexattr_destroy: 0




Это как понимать.



Вдобавок, выдаржка из man (3) pthread_XXX :





pthread_mutex_lock()

...

If the mutex type is PTHREAD_MUTEX_NORMAL, deadlock detec-

tion is not provided. Attempting to relock the mutex causes

deadlock. If a thread attempts to unlock a mutex that it has

not locked or a mutex that is unlocked, undefined behavior

results.



If the mutex type is PTHREAD_MUTEX_ERRORCHECK, then error

checking is provided. If a thread attempts to relock a mutex

that it has already locked, an error will be returned. If a

thread attempts to unlock a mutex that it has not locked or

a mutex which is unlocked, an error will be returned.



If the mutex type is PTHREAD_MUTEX_RECURSIVE, then the

mutex maintains the concept of a lock count. When a thread

successfully acquires a mutex for the first time, the lock

count is set to 1. Every time a thread relocks this mutex,

the lock count is incremented by one. Each time the thread

unlocks the mutex, the lock count is decremented by one.

When the lock count reaches 0, the mutex becomes available

for other threads to acquire. If a thread attempts to

unlock a mutex that it has not locked or a mutex that is

unlocked, an error will be returned.

...

The pthread_mutex_trylock() function is identical to

pthread_mutex_lock() except that if the mutex object refer-

enced by mutex is currently locked (by any thread, including

the current thread), the call returns immediately.



О чёрно-белой фотографии

via :

У человека в глазу два типа рецепторов: интенсивности света и длины волны. Цветная фотография воспринимается рецепторами обоих типов. Чёрно-белая фотография воспринимается только палочками, при этом колбочки, которые воспринимают цвет, отдыхают.

В мозгу информация от рецепторов двух типов воспринимается двумя разными областями. Чёрно-белый канал информации передаёт собственно информацию, что и где. Цветной канал несёт информацию дополнительную, часто эмоциональную.

Чёрно-белые фотографии имеют меньше степеней свободы, поэтому в них смысл кажется более сконцентрированным. Неся меньше визуальной информации, они заставляют вас больше задуматься. Они более универсальны, так как восприятие цвета у людей не однозначно.

Чёрно-белая фотография - не недостаток технологии, а способ видеть мир.

факты из книги "Vision and Art: The biology of seeing", by Margaret Livingstone.

Tuesday, November 22, 2005

Tuesday, November 15, 2005

Шутка из одного форума

Удивительно, но в русском языке бывает так, что предложение, составленное из пяти глаголов неопределенной формы, имеет смысл: "Заставить встать сходить купить выпить".

Дыбра - это животное в дебрях тундры, вроде бобра и выдры, враг кобры и пудры, бодро тибрит ядра кедра в ведрах и дробит добро в недрах...

О сравнении фотоаппаратов, техники, т.п., т.д.

via < ГРАФИК > ( форум@mformat.com )

Это так же, как и сравнивать рыболовные крючки: всё круто - но не клюёт и рыбы нет.

Friday, November 11, 2005

Яйцелов

Ностальгировать!
http://sy.vision.kz/games/nu_pogodi.swf

Ещё линки

http://www.lostamerica.com/
http://www.art-dept.com/artists/borsodi/
http://www.davidwaitz.com/
http://www.phantomile.biz/pixelpost_1.4.1/index.php?x=browse&category=1
http://www.wolfgangmothes.de/
http://www.merfeldcollodion.com/index_col.html
http://www.photography-museum.com/mutter/scottmutterNewGallery.html
http://www.luguber.net/luguberv10/gallery.html
http://www.picturesbyarthursteel.co.uk/
http://www.livejournal.com/users/keyman/7182.html

Немного фотоссылок

Наслаждайтесь.

http://www.zija.net/
http://www.worldpressphoto.com/?bandwidth=low
http://www.hevanet.com/cperez/
http://kanaxis.tele-kom.ru/photo/html/
http://worldleonard.h1.ru/
http://www.esohodepot.com/port1wk6/
http://www.still-photo.net/wedding/home.htm
http://www.training.belhard.com/photo/index.html
http://kievaholic.com/lenstests2.html
http://www.ishizuka-takao.net/materials/
http://www.geh.org/
http://www.drawingsociety.com/dscgallery/
http://www.jamesnachtwey.com/
http://www.ohlsson.de/index.html
http://www.nickbrandt.com./
http://www.eoloperfido.com/index.htm
http://www.acecam.com/cr-menu.html
http://www.codemastersworkshop.com/frontdoor/index.htm
http://www.bobmartin.com/
http://www.cpi-reps.com/
http://www.amivitale.com/main.html
http://www.pinhole.ru/
http://www.safinruslan.com/
http://www.andreas-hering.com/MainPage/index.php
http://www.ruudvanempel.nl/
http://www.gilbert-garcin.com/
http://www.lippoth.com/website/index.html
http://transfer.to/lovisa
http://www.jamesravilious.com/gallery.asp
http://www.olicito.de/
http://www.ryuijie.com/
http://www.barbaracole.com/index.htm

pi's Yet Another Bloody List of Acronyms

Самый, пожалуй, полный словарь "сокращений".


              pi's Yet Another Bloody List of Acronyms

AAMOF as a matter of fact
ADN any day now
AFAIC as far as I'm concerned
AFAICS as far as I can see
AFAICT as far as I can tell
AFAIK as far as I know
AFAIR as far as I remember
AFK away from keyboard
AISB as I said before
AISI as I see it
AIUI as I understand it
AKA also known as
ANFAWFOS and now for a word from our sponsor
ANFSCD And now for something completely different...
ASAP as soon as possible
ATLA another three letter acronym
AWGTHTGTATA Are we going to have to go through all this again?
AWGTHTGTTA Are we going to have to go through this again?
AYOR at your own risc
BAK back at keyboard
BBL be back later
BBS be back soon
BCNU be seeing you
BF boyfriend
BFN bye for now
BOT back on topic
BRB be right back
BSF but seriously folks
BST but seriously though
BTAIM be that as it may
BTDT been there done that
BTHOM Beats the hell outta me!
BTSOOM Beats the shit out of me!
BTW by the way
BTWBO Be there with bells on.
CMIIW Correct me if I'm wrong.
COTFLGOHAHA Crawling on the floor laughing guts out and having a heart attack.
CU See you.
CUA commonly used acronym
CUL See you later.
CUL8R See you later.
CWYL Chat with you later.
CYA Cover your ass.
D&C Duck and cover.
DILLIGAD Do I look like I give a darn?!
DILLIGAF Do I look like I give a fuck!
DNPM darn near pissed myself
DUCWIC Do you see what I see?
DWISNWID Do what I say not what I do.
DYHWIH Do you hear what I hear?
DYJHIW Don't You just hate it when...
E2EG ear to ear grin
EOD end of discussion
EOF end of file
EOS end of show
ESAD Eat shit and die!
ESAL Eat shit and live!
ETLA extended three letter acronym
FAAK falling asleep at keyboard
FAFWOA for a friend without access
(Blush-blush really dumb question coming up)
FIFO first in first out
FITB Fill in the blank.
FOAD Fuck off and die.
FOAF friend of a friend
FOAFOAG father of a friend of a girlfriend
FOAG father of a girlfriend
FOC free of charge
FTASB faster than a speeding bullet
FTL faster than light
FU fucked up
FUBAR fucked up beyond all recognition
FUBB fouled up beyond belief
FUD (spreading) fear, uncertainty, and disinformation
FWIW for what it's worth
FYA for Your amusement
FYE for Your entertainment
FYI for your information
GA go ahead
GAFIA get away from it all
GAL get a life
GF girlfriend
GFAK go fly a kite
GGN gotta go now
GIGO garbage in, garbage out
GIWIST Gee, I wish I'd said that.
GR&D grinning, running & ducking
GMTA great minds think alike
GTFOOMF Get the fuck out of my face.
HAK hugs and kisses
HAND have a nice day
HLOL hysterically laughing out loud
HLOLARAWCHAWMP hysterically laughing out loud and rolling around while clapping hands and wetting my pants
HOMPR Hang on, mobile phone's ringing.
HTH hope this helps
HWS(PEST) husband wants sex (please excuse slow typing)
HWTHMBO he who thinks he must be obeyed
HWTHKE he who thinks he knows everything
IAC in any case
IAE in any event
IANAL I am not a lawyer (also IANAxxx, such as IANACPA)
IANALBIPOOTV I am not a lawyer, but I play one on TV
IARTPFWTSIOWIM I am repeating this parrot-fashion with out the slightest idea of what it means.
IBC inadequate, but cute
IBTD I beg to differ.
IDGAD I don't give a damn.
IDGAS I don't give a shit.
IDK I don't know
IRL in real life
IIRC If I recall correctly
IITYWIMWYBMAD If I tell you what it means will you buy me a drink?
IITYWTMWYKM If I tell you what this means will you kiss me?
IIWM if it were me (mine)
ILIWTPCT I love it when the plan comes together
ILSHIBAMF I laughed so hard I broke all my furniture!
ILSHIBATF I laughed so hard I broke all the furniture.
IMBO in my biased opinion
IMCAO in my completely arrogant opinion (Use for attracting flames!)
IMCO in my considered opinion
IME in my experience
IMHO in my humble opinion
IMNSHO in my not so humble opinion
IMO in my opinion
INPO in no particular order
IOW in other words
ISTM it seems to me
ISTR I seem to recall
ITA I totally agree
IYSWIM If You see what I mean.
JAM Just a minute.
KISS keep it simple, stupid
LIFO last in first out
LLTA Lots and lots of thunderous applause!
LMFAO Laughing my fucking ass off.
LOL lots of luck or laughing out loud
LSHMSH laughing so hard my side hurts
LTIP laughing till I puke
MFG more friendly garbage
MFTL my favorite toy language
MHOTY my hat's off to you
MMIF my mouth is full
MTFBWY May the force be with you!
MYOB Mind your own business!
NALOPKT Not a lot of people know that.
NBD no big deal
NFI no friggin' idea
NFW no fucking way
NIMBY not in my back yard
NRN no reply necessary
NTL nevertheless
NTTAWWT not that there's anything wrong with that
OAO over and out
OATUS on a totally unrelated subject
OAUS on an unrelated subject
OBTW oh, by the way
OIC Oh, I see!
ONNA Oh no, not again!
ONNTA Oh no, not this again!
OOTB out of the box (brand new)
OOTC obligatory on-topic comment
OTC Over the counter
OTOH on the other hand
OTOOH on the other other hand
OTT over the top
OTTH on the third hand
OTTOMH off the top of my head
OTTOMHAROOB off the top of my head and rolling out of bounds
OTW on the whole
OWTTE or words to that effect
PD public domain
PITA pain in the ass
PMFJI pardon me for jumping in
PMIGBOM Put mind in gear, before opening mouth!
PMYMHMMFSWGAD Pardon me, you must have mistaken me for some one who gives a damn
POV point of view
RAEBNC Read and enjoyed, but no comment.
ROTBA reality on the blink again
ROTFFNAR rolling on the floor for no apparent reason
ROTFL rolling on the floor laughing (also, ROFL)
ROTFLAHMS ... and holding my sides
ROTFLASTC ... and scaring the cat
ROTFLBTC ... biting the carpet
ROTFLBTCACTC ... ... and scaring the cat
ROTFLBTCASTCIIHO ... ... ... if I had one
ROTFLBTCDICAJTTWADBSIHPWTRHITSBKABAYB ... ... dancing in circles and jumping through the window almost dieing by smashing into HP who's then running horrified into the street beeing killed accidentally by a yellow bulldozer
ROTFLBTCUTS ... ... unable to stop
ROTFLGO ... guts out
ROTFLMAO ... my ass off
ROTFLOL ... out loud
ROTFLOLVH ... out loud very hard
ROTFTPOF ... trying to put out flames
ROTFLSTC ... scaring the cat
ROTFWTIME rolling on the floor with tears in my eyes
RSN real soon now (which may be a long time coming)
RTFAQ read the FAQ
RTFI read the fucking instructions
RTFM read the fucking manual
RTFMA read the fucking manual, again
RTFMS Read the fucking manual, sir! (from the military)
RUOK Are You OK?
SBCN Sitting behind the computer naked.
SCNR Sorry, couldn`t resist.
SHM Shit happens, mate.
SICS sitting in chair snickering
SIMCA sitting in my chair amused
(for something not quite as funny as to deserve ROTFL)
SITD still in the dark
SMOP small matter of programming
SNAFU situation normal, all fucked up
SNR signal to noise ratio
SO significant other
SOI stunk on ice
SWMBO wife (she who must be obeyed)
TAFN that's all for now
TANJ there ain't no justice
TANSTAAFL there ain't no such thing as a free lunch
TARFU things are really fouled up
TGAL think globally, act locally
TIA thanks in advance
TIC tongue in cheek
TINALO this is not a legal opinion
TINAR this is not a recommendation
TINWIS that is not what I said
TLA three-letter acronym (such as this)
TMTOWTDI there's more than one way to do it
TNOTVS theres nothing on TV so,....
TNX thanks
TPS(S) this program sucks (severely)
TPTB the powers that be
TRDMC tears running down my cheeks
TSOHF total sense of humor failure
TTBOMK to the best of my knowledge
TTFN ta ta for now
TTYL talk to you later
TTYRS talk to you real soon
TUFD the user file died
TVM thanks very much
TYCLO Turn your CAPS LOCK off. (Quit shouting.)
TYVM thank you very much
UBD user brain damage
UPGS unfinished project guilt syndrome
UTC under the counter
UTT under the table
VETLA very enhanced TLA
VR virtual reality
WAB? What another bill?
WAG wild ass guess
WDYMBT What do you mean by that?
WGAS Who gives a shit?
WIBAMU Well, I'll be a monkey's uncle.
WIBNI would it be nice if
WMMOWS Wash my mouth out with soap!
WNOHGB where no one has gone before
WRT with regard to
WT without thinking
WTF what the fuck
WTFDYTYA Who the fuck do you think you are?
WTFWT What the fuck was that?
WTH what the hell
WTTM without thinking too much
WWS wife wants sex
WYLABOCTGWTR Would you like a bowl of cream to go with that remark?
WYLASOMWTC Would you like a saucer of milk with that comment?
WYTYSYDG What you thought you saw, you didn't get.
YAOTM yet another off-topic message
YHGASP You have got a serious problem
YKINMK Your Kink Is Not My Kink
YKINOK Your Kink Is Not Okay
YKIOK,IJNMK Your Kink is OK, It's Just Not My Kink
YMBJ You Must Be Joking
YMMV Your mileage may vary
YSS You suck severely
YWSYLS You win some, you lose some



upd: ещё http://www.noslang.com/dictionary.php

Рекомендую посмотреть...

http://museum.defa.ru/

Thursday, November 10, 2005

О кюветах.

Друзья, а ни у кого часом не завалялось кювет из прошлой жизни?
В идеале нужно 4 кюветы 40*50 (для бумаги 30*40).
Две было б тоже здорово.

А, вдруг?

Сенкс.

Wednesday, November 9, 2005

Sony Rootkit

via
http://www.sysinternals.com/blog/2005/10/sony-rootkits-and-digital-rights.html

Деталь компьютера

Я - хард
Иначе говоря, винчестер. Хранитель информации. А кто владеет информацией, тот владеет миром, важно помнить. Не смотря на возможную молчаливсть, вы являетесь сутью и содержанием, если так можно выразиться, компьютера. Но по жизни помните, что в принципе под лежачий камень вода затекает редко, и если дело совсем плохо, то надо срочно искать того, кто станет процессором и "мозгом". А там уж и до целой машины недалеко.

Пройти тест 'Какая ты деталь компьютера?'

Monday, November 7, 2005

Не люблю я такие записи, но что делать - крик души, так сказать.

В Москве, 27.11 будет концерт Judas Priest.
Это ж детство, можно так сказать. Как можно это пропустить, но видимо надо будет пропустить, как обидно-обидно-обидно.

Ой.

update: Сегодня достану старые кассеты, до сих пор помню, что Painkiller записан на _хромовой_ TDK 90 минут. Включу, буду слушать. И соседи тоже должны послушать.

Thursday, November 3, 2005

Проблемы с GDM, x-сервером, RHEL4




Приветствую.

Проблема в слеующем. Есть машина под linux (RHEL) в локалке. Запущен GDM.
Правки в gdm.conf приводят к адекватным изменениям logon'а.
В конфиге, в секции [xdmcp] xdm разрешён.

Запускается Exceed (в режиме "в окне"). Broadcast'ом "видит" xdmcp от gdm.
После нажати на "ok" соединяется. НО. Окно x-сервера остаётся серым (хотя я ожидаю gdmchooser/gdmlogin/gdmgreeter).
Если в запущенном терминале сделать
export DISPLAY=ip:0.0
xterm/whatelse/xclock...
В x-сервере соответствующее окно появляется.

Ясобственно ожидаю появления gdmchooser/gdmlogin/gdmgreeter (что я там пробую прописать в gdm.conf) с тем, чтобы собственно залогиниться и работать в нужном мне wm.

?

ps: на самой машине, локально, всё нормально происходит.

Добавление от 03.11.2005 19:58:

update:

код:

[rezdm@dmr-lin ~]$ X -query localhost

Fatal server error:
PAM authentication failed, cannot start X server.
Perhaps you do not have console ownership?


Please consult the The X.Org Foundation support
at http://wiki.X.Org
for help.

[rezdm@dmr-lin ~]$


Казалось бы дело стало проще, ан нет...

Добавление от 03.11.2005 20:44:

Проблема решилась после конфигурации через гуй(sic!) в KDE.




Изначально вопрос был задан форуме Ixbt