|
From: <mut...@us...> - 2010-04-25 15:14:58
|
Revision: 612
http://libmage.svn.sourceforge.net/libmage/?rev=612&view=rev
Author: mutanabbi
Date: 2010-04-25 15:14:52 +0000 (Sun, 25 Apr 2010)
Log Message:
-----------
zzz
Added Paths:
-----------
gentoo-configs/mutanabbi/common/home/radja/docs/c++ terms.txt
gentoo-configs/mutanabbi/common/home/radja/docs/c++ interview questions.txt
gentoo-configs/mutanabbi/common/home/radja/docs/ex1.txt
gentoo-configs/mutanabbi/common/home/radja/docs/interview speech.txt
gentoo-configs/mutanabbi/common/home/radja/docs/interview vocabluary.txt
gentoo-configs/mutanabbi/common/home/radja/docs/piano.txt
gentoo-configs/mutanabbi/common/home/radja/docs/zodiac.txt
Added: gentoo-configs/mutanabbi/common/home/radja/docs/c++ terms.txt
===================================================================
--- gentoo-configs/mutanabbi/common/home/radja/docs/c++ terms.txt (rev 0)
+++ gentoo-configs/mutanabbi/common/home/radja/docs/c++ terms.txt 2010-04-25 15:14:52 UTC (rev 612)
@@ -0,0 +1,12 @@
+pivot element - опорный элемент
+name mangling
+SFINAE - Substitution Failure Is Not An Error
+RAII - resource Acquisition is initialisation
+CRTP - Curiously Recurring Template Pattern,
+stack will be unwound - стек будет раскручен
+stack unwinding
+stack will be popped
+dangling - висячий
+dangling pointer
+acronym
+round bracket operator
\ No newline at end of file
Property changes on: gentoo-configs/mutanabbi/common/home/radja/docs/c++ terms.txt
___________________________________________________________________
Added: svn:keywords
+ Id HeadURL Revision Date Author
Added: svn:eol-style
+ native
Added: gentoo-configs/mutanabbi/common/home/radja/docs/c++ interview questions.txt
===================================================================
--- gentoo-configs/mutanabbi/common/home/radja/docs/c++ interview questions.txt (rev 0)
+++ gentoo-configs/mutanabbi/common/home/radja/docs/c++ interview questions.txt 2010-04-25 15:14:52 UTC (rev 612)
@@ -0,0 +1,55 @@
+ * What are the major differences between C and C++?
+ o What are the differences between new and malloc?
+ o What is the difference between delete and delete[]?
+ o What are the differences between a struct in C and in C++?
+ o What are the advantages/disadvantages of using #define?
+ o What are the advantages/disadvantages of using inline and const?
+ * What is the difference between a baller and a reference?
+ o When would you use a baller? A reference?
+ o What does it mean to take the address of a reference?
+ * What does it mean to declare a function or variable as static?
+ * What is the order of initalization for data?
+ * What is name mangling/name decoration?
+ o What kind of problems does name mangling cause?
+ o How do you work around them?
+ * What is a class?
+ o What are the differences between a struct and a class in C++?
+ o What is the difference between public, private, and protected access?
+ o For class CFoo { }; what default methods will the compiler generate for you>?
+ o How can you force the compiler to not generate them?
+ o What is the purpose of a constructor? Destructor?
+ o What is a constructor initializer list?
+ o When must you use a constructor initializer list?
+ o What is a:
+ + Constructor?
+ + Destructor?
+ + Default constructor?
+ + Copy constructor?
+ + Conversion constructor?
+ o What does it mean to declare a...
+ + member function as virtual?
+ + member function as static?
+ + member function as static?
+ + member variable as static?
+ + destructor as static?
+ o Can you explain the term "resource acquisition is initialization?"
+ o What is a "pure virtual" member function?
+ o What is the difference between public, private, and protected inheritance?
+ o What is virtual inheritance?
+ o What is placement new?
+ o What is the difference between operator new and the new operator?
+ * What is exception handling?
+ o Explain what happens when an exception is thrown in C++.
+ o What happens if an exception is not caught?
+ o What happens if an exception is throws from an object's constructor?
+ o What happens if an exception is throws from an object's destructor?
+ o What are the costs and benefits of using exceptions?
+ o When would you choose to return an error code rather than throw an exception?
+ * What is a template?
+ * What is partial specialization or template specialization?
+ * How can you force instantiation of a template?
+ * What is an iterator?
+ * What is an algorithm (in terms of the STL/C++ standard library)?
+ * What is std::auto_ptr?
+ * What is wrong with this statement? std::auto_ptr ptr(new char[10]);
+ * It is possible to build a C++ compiler on top of a C compiler. How would you do this?
\ No newline at end of file
Property changes on: gentoo-configs/mutanabbi/common/home/radja/docs/c++ interview questions.txt
___________________________________________________________________
Added: svn:keywords
+ Id HeadURL Revision Date Author
Added: svn:eol-style
+ native
Added: gentoo-configs/mutanabbi/common/home/radja/docs/ex1.txt
===================================================================
--- gentoo-configs/mutanabbi/common/home/radja/docs/ex1.txt (rev 0)
+++ gentoo-configs/mutanabbi/common/home/radja/docs/ex1.txt 2010-04-25 15:14:52 UTC (rev 612)
@@ -0,0 +1,30 @@
+
+
+1. I'll go to the New Zealand, since I'll pass the test
+
+
+2. I looked to a window. There was a heavy rain. The cold wind blew.
+
+
+3. What are you doing? You have been trying to open door with wrong key during 5 minutes already.
+
+
+4. It just has been showed to us how to go online.
+
+
+5. Why are all people always laugh at him?
+
+
+6. This data is very hard for receiving.
+
+
+7. Actress looks amaizing thought she has been more than fifty long time ago.
+
+
+8. If I was you, I'd accept this offer.
+
+
+9. It isn't our money. Put it on a table.
+
+
+10. No one student of first course could make this excersise.
Property changes on: gentoo-configs/mutanabbi/common/home/radja/docs/ex1.txt
___________________________________________________________________
Added: svn:keywords
+ Id HeadURL Revision Date Author
Added: svn:eol-style
+ native
Added: gentoo-configs/mutanabbi/common/home/radja/docs/interview speech.txt
===================================================================
--- gentoo-configs/mutanabbi/common/home/radja/docs/interview speech.txt (rev 0)
+++ gentoo-configs/mutanabbi/common/home/radja/docs/interview speech.txt 2010-04-25 15:14:52 UTC (rev 612)
@@ -0,0 +1,54 @@
+Why psychology? Why such a strange choice?
+======================================
+My first education was related to [or was to do with] computer sciences. And after I graduated as bachelor I decided to continue my education in another science area - in humanities. So It was very interesting experience. And at the same time I worked in IT.
+
+
+Rosta
+=====
+During my last two years at university I worked at the IT-department of company Rosta. It is one of the largest Russian pharmaceutical companies. I worked at the IT-department of the north-west division. My work area incorporated development of the electronic order system. I began from the enhancement of the communication module. I implemented the uucp protocol and access method over http. After that I was appointed to maintain user-side gui-oriented and server-side components of the system. So I was in charge of maintaining and administrating Linux servers.
+
+Leaving/workchange/resign reasons:
+==================================
+So Rosta it is a trade company only. And I wanted to grow as a developer. And after three years of working there I applied to some software development and outsourcing companies.
+
+
+StarSoft
+========
+Star Soft Development (now it is called Exigen Services). It is an outsourcing company in Saint-Petersburg. I worked with the project of Californian company Web Side Story based in San-Diego. It was a service provider of web analytical services. We developed and maintained some components of their main product Hitbox Analytics. There was some component which was called Hitbox Gateway Server. It was my work area. Essentially it was an http web server which logged requests from java-script components injected to pages of customers' web-sites.
+
+Leaving reasons:
+================
+WSS was taken over by their larger competitor Omniture. Omniture had their own web analytic product and almost all development was wrapped up. We got bug fix tasks only, cause Omniture continued to support old customers. Exigen had no other projects incorporating any technology I was interested in; all other projects were windows- and java- oriented. So it wasn't interesting for me and I started to look for another job.
+
+
+AdNet
+=====
+AdNet is a part of Ros Business Consulting corporation. It has its own advertising and banner changing system. At that moment some old components which were written in PHP meet [didn't satisfy] loading requirements. So I designed and developed some internal services for AdNet from "zero". It was cache server of keyword requests and a web-spider with a lexical analyzer for grubbing keywords from customers' web-sites. We needed tools to associate banner net customers' pages with relevant keywords automatically. The cache server was written in C++ as Apache module. Spider and lexical analyzer were written in Python like hook for "mod_python" Apache module.
+
+Leaving reasons:
+================
+In that year the crisis broke out. And our department (was?) closed down.
+
+
+GS
+==
+General Satellite is a manufacturing company. It produces digital satellite TV solutions and has its own software development department. Here I was involved into the project developing Linux-based firmware for digital TV set-top box. I didn't work there very long. So I made refactoring of gui library used by some GS projects for set-top boxes. And I wrote some library primitives: multithread signals dispatcher, light interprocess data base for internal use and so on.
+
+Leaving reasons:
+================
+The reasons are very difficult working conditions and extremely low development culture level. I thought I didn't want to work in a team where I had to fight for good practices every day. For example, the developer responsible for my project (my tech-lead in fact) was certain that a smart pointers is a very complex and unusable technique. And so on. And when I got an offer to be a team-lead in another company I thought it was a good opportunity for me.
+
+
+N PKB
+=====
+North PKB is a governmental defense company. It has a contract with Indian navy for developing some program modules for the combat management system. They had been working on these modules for two years without good results. So their crisis manager invited [appointed, selected] me to head the development team. So I had to build some development process and improve technical skills of developers. In addition, I had to make full code review, necessary refactorings and run that code under powerpc architecture.
+I was surprised that there wasn't a single engineer who could be called a junior developer at least. The guys had very basic skill in C++ and software development in generally. As a result there were very strange project solutions (for example: using thread id as array index, the multitude of duplicated data, unreasonable inheritance (log channel is a thread!)). So I rewrote the system library and modules framework and we made a great number of refactorings. We introduced a version control system (Subversion), a bug-tracker(Trac), a project internal e-mail server and so on.
+
+Leaving reasons:
+================
+Frankly my experience of working with military men wasn't good. Military chiefs are very conservative. [I faced with a powerful resistance to change] Modern approaches and practices were often rejected (bug-tracker for example, svn was accepted with great difficulty). I understood that I was limited as a team lead. So I resigned after I finished all my tasks.
+
+
+Footer
+======
+I'd like to find an interesting job where I could grow as a professional. I'd want to be a leader of the developers' team or a system architect of some strong server-side high-loaded system. I just want to be proud of my job :). So of course working in an english-speaking team could be an excellent opportunity for me.
\ No newline at end of file
Property changes on: gentoo-configs/mutanabbi/common/home/radja/docs/interview speech.txt
___________________________________________________________________
Added: svn:keywords
+ Id HeadURL Revision Date Author
Added: svn:eol-style
+ native
Added: gentoo-configs/mutanabbi/common/home/radja/docs/interview vocabluary.txt
===================================================================
--- gentoo-configs/mutanabbi/common/home/radja/docs/interview vocabluary.txt (rev 0)
+++ gentoo-configs/mutanabbi/common/home/radja/docs/interview vocabluary.txt 2010-04-25 15:14:52 UTC (rev 612)
@@ -0,0 +1,323 @@
+Читаем bbc.co.uk
+ learning english
+ general and buisness english
+ talking buisness
+
+
+down size - сокращение
+close down - отдел закрыт по сокращению
+ redundant
+ Our department was closed down
+
+redundant - уволенный по сокращению штатов
+
+as well
+on my own
+sufficiently - достаточно
+good enough
+ My professional level is good enough for that.
+ My professional level is sufficient for that.
+ My professional level is sufficiently high for that.
+
+load (hi-loaded systems)
+
+improve my mathematical skills
+i would like to be (improve smth, another verb.)
+holidays - праздники, выходные, отпуск
+appreciate - высоко оценивать; быть признательным, благодарным
+ I appreciate that
+ I appreciate your attention
+
+architect - архитектор (читается через k - аркитект)
+architecture - архитектура
+company - компания (читается через A - кАмпани)
+technique - текн'ик
+iterator - итерейта
+powerful
+idiom - идиом
+semantics - все что заканчивается на ика в русском языке
+ с большой вероятностью заканчивается на -ics в английском
+ примеры: математика, физика
+similar to -
+macros - мэйкрэс
+
+What's that word?
+It is a very bad line!
+Could you say .... please?
+Hold on, please!
+Speaking! - Я слушаю. Это я. Важно! Без I'm
+Thank you for calling
+ appreciate
+ attention
+
+It isn't easy to answer it.
+There is no easy way to answer it.
+It is a difficult quastion
+Let me think how can I put it
+
+You are very kind
+It's all right
+Don't mention it
+Just forget about it
+
+Do you mind if I ask you some questions
+ ВАЖНО! No - положительный ответ в данном случае, означающий - Нет, не возражаю!
+
+Could you speak more slowly, please?
+Could you speak up, please?
+ Всегда добавляем please к любой просьбе. Иначе звучит грубо.
+
+My battery is running out.
+We can be cut off
+Could you call back again, please?
+Call me on .... my phone number
+ country code +7
+ area code 812
+
+dial - набрать
+
+Don't call off
+Don't drop the line
+
+be in charge of - ответственен за. Означает и отвечать и руководить
+be responsible for - быть ответственным за некую область или действие
+deal with
+smb working under me
+liaise with - контактировать, связываться
+look after smth - контролировать, надзирать, присматривать
+my junior colleagues
+directly to - читается дИректли или дАйректли
+run the business on a day-to-day basis (бэйсис)
+ вести, руководить
+take care of == look after
+ Take care of you - береги себя
+
+launch - читается лОнч
+
+deal with }
+look into } a problem
+sort (местоимение) out }
+местоимение всегда именно тут
+
+describe }
+identify } the symptoms
+treat }
+(лечить)
+
+diagnose }
+locate } the fault
+repair }
+
+escalate (поднять) }
+fax } the problem a supervisor
+refer (отослать) }
+
+
+
+attend - посещать
+conduct - [кондАкт] проводить (интервью smth)
+panel - [пЭнэл] комиссия, группа людей, занятых единым делом
+dismiss - увольнять
+argue - спорить
+appoint - назначать
+short-list - verb. отобрать (для чего-то)
+
+easy as falling off the log - Легко как упасть с бревна. В смысле легче легкого.
+ Проще чем отобрать конфетку у младенца
+
+bachelor - [бЭчела] холостяк, бакалавр
+off - предлог, указывающий на разъединение, разрыв в пространстве
+resign form ... - [реЗайн] уйти по собственному желанию
+
+hire smb as [Эз] Quality Manager - с предлогом
+appoint smb Quality Manager - без предлога
+
+So uncomfortable! - легальный способ ругнуться :). Аналог Блин!
+
+on the spot - на месте, сразу
+problem shooting - выявление проблемы, диагностика
+
+During the past two weeks - в течении двух недель
+In the past two ... - в последние две недели
+Two weeks ago ... - две недели назад
+
+assess - оценивать, давать оценку
+ be assessed
+ assess the problem
+incorporate - включать в себя, присоединять
+ ВАЖНО: работает "в обе стороны" (множество включает или включить во множество)
+
+enhance - улучшить, усилить, усовершенствовать
+ Could we enhance our spaceship's guard with it?
+ the guard of our space ships?
+ ВАЖНО: Смотрим на разницу в использовании суффикса s. Возможны только эти два способа
+
+relate - соотносить, относиться
+closely supervised - тщательно наблюдать
+employment - трудоустройство
+
+etc == et cetera
+ == and so on
+
+using --> through по отношению к методу, схеме, плану действия
+ ВАЖНО: Никогда не использовать для фраз типа "позвони мне по другому телефону"
+
+apply to - подать заявление на вакансию, обратиться по вакансии
+apply for - подать заявление в компанию {for vs to}
+train`ee - стажер
+ -ee суффикс указвает на получателя действия
+ ударение ВСЕГДА на -ee
+
+taken over [оувэ] by a larger competitor
+
+competitor - конкурент
+hang - висеть, повесить
+hang up - повесить трубку
+up - выражает идею законченности действия
+ off - насильственный разрыв cut off
+ up - доведение до логического конца hang up
+
+get through - дозвониться, дозваниваться
+put smb through to ... - соединить с ...
+put down - записать
+get back to smb. - перезвонить, вернуться к рассмотрению, связаться снова
+
+Let me start again } когда запутался и начинаешь сначала
+I will start again }
+
+another (an other) - другой ЕДИНИЧНЫЙ (an - артикль единственного числа) объект
+other - другие
+
+derived
+base
+
+facilities - возможность, мощности (материальная предпосылка)
+opportunities - возможность, шанс. Всегда "хорошая" возможность
+ carrier opportunities
+
+
+ +----------- Причастие ------------+
+ | |
+ Активное -ing Пассивное -ed (3 form)
+ incorporating incorporated
+ включающий в себя включенный в
+
+Indulgences
+===========
+I wanted a job with more responsibility
+I wanted to develop my potential
+I have always to work in your company
+ Because it has a great reputation and is very successfully on the market
+It would be a fantastic opportunity for me
+
+Возможности
+===========
+opportunity - хорошая конструктивная возможность
+possibility - возможность/вероятность, что smth произойдет или нет
+facility - техническая возможность
+probability - вероятность, шанс
+
+more expensive - более дорогой, более затратный
+more cheaper - более дешевый
+
+Слишком мало
+============
+too little - для неисчисляемых
+too few - для исчисляемых во множественном числе
+not enough - универсальный вариант
+
+occur [экё]
+error [`эра]
+
+often - часто
+
+If I understand the situation correctly
+Bear with me - подождити
+I didn't explain that clearly, what I mean is ...
+ Я не совсем верно объяснил, я имел в виду, что ...
+Could I have more time for that?
+So, what you are saying is ...
+
+discount - льгота, скидка
+be entitled to smth - иметь право на
+go over - проходить по списку, обсуждать, суммировать
+sort out - разобраться, выяснить
+
+put on - надеть
+put back - забрать
+put forward - внести (предложение)
+
+meet deadline - уложиться в срок
+It wasn't my fault
+
+achieve - достигать, добиваться } compromise
+reach - достигать, добиваться, дотянуться }
+
+sure
+ I'm not sure
+
+odd one out - лишний
+unnecessary
+
+
+pathname
+
+what you may call it [whachamacallit]
+choosy - трудный, привередливый
+time consuming - затратный в отношении времени
+invite - приглашать
+invition - приглашение
+acceptable - приемлемый
+fortnight - две недели
+rarely - редко
+ saldom
+recently - недавно
+ [р`исентли]
+the other day - на днях (в прошлом)
+another day - в другой раз
+ разница в артикле
+pronunciation - произношение
+for year - в течении года
+within a year - в пределах года
+ some type
+ --"--
+get sloshed - нажраться. Усиленное get drunk
+nasty - вредный
+
++=====================+
+| I am going to + inf |
+| I'm gonna + inf |
++=====================+
+
+1. Выражает намерение
+ I'm gonna finish the task by Thursday
+2. Прогнозирование на основе признаков
+ It's bonna be raining
+
+I haven't done a crossrun for ages
+
+see in ] Встречать чей-то приход
+see smth in smb ]
+
+feed (fed, fed) - кормить
+
+hide (hid, hidden) - прятаться
+candy floss - сладкая вата
+ginger bread man - пряничный человечек
+
+I haven't eatten ... since I was a child
+
+since - с тех пор, как
+science - наука
+
+
+1. I'll go to the New Zealand, since I'll pass the test
+2. I looked to a window. There was a heavy rain. The cold wind blew.
+3. What are you doing? You have been trying to open door with wrong key during 5 minutes already.
+4. It just has been showed to us how to go online.
+5. Why are all people always laugh at him?
+6. This data is very hard for receiving.
+7. Actress looks amaizing thought she has been more than fifty long time ago.
+8. If I was you, I'd accept this offer.
+9. It isn't our money. Put it on a table.
+10. No one student of first course could make this excersise.
Property changes on: gentoo-configs/mutanabbi/common/home/radja/docs/interview vocabluary.txt
___________________________________________________________________
Added: svn:keywords
+ Id HeadURL Revision Date Author
Added: svn:eol-style
+ native
Added: gentoo-configs/mutanabbi/common/home/radja/docs/piano.txt
===================================================================
--- gentoo-configs/mutanabbi/common/home/radja/docs/piano.txt (rev 0)
+++ gentoo-configs/mutanabbi/common/home/radja/docs/piano.txt 2010-04-25 15:14:52 UTC (rev 612)
@@ -0,0 +1,4 @@
++7 921 747 42 09
+Вторник. 10:00
+Иван Владимирович
+настройщик фортепиано
\ No newline at end of file
Property changes on: gentoo-configs/mutanabbi/common/home/radja/docs/piano.txt
___________________________________________________________________
Added: svn:keywords
+ Id HeadURL Revision Date Author
Added: svn:eol-style
+ native
Added: gentoo-configs/mutanabbi/common/home/radja/docs/zodiac.txt
===================================================================
--- gentoo-configs/mutanabbi/common/home/radja/docs/zodiac.txt (rev 0)
+++ gentoo-configs/mutanabbi/common/home/radja/docs/zodiac.txt 2010-04-25 15:14:52 UTC (rev 612)
@@ -0,0 +1,44 @@
+Несколько вопросов к ТЗ
+=======================
+Как блокирующая очередь может быть асинхронной? Это протиповоложные понятия. Асинхронность подразумевает, что ни один из вызовов не блокируется. Или в ТЗ под асинхронностью подразумевается параллельность?
+
+Что означает фраза в ТЗ о том, что "механизм нотификаций обеспечивает возможность приостановки и возобновления...". Означает ли это, что IMessageQueueEvent это шаблон Observer? В таком случае, я не вижу в диаграмме классов соответствующих методов для регистрации обработчиков событий и т.п. Если это Policy, то я не вижу методов для передачи в нею back reference на host-класс.
+
+Для реализаци полноценной остановки деятельности потоков писателей/читателей, необходимо уснуть в condition variable, освободив мьютекс, синхронизирующий доступ к методам класса MessageQueue. Для этого, в свою очередь, необходим доступ к объекту этого класса. Каким образом, в рамках предложенного ТЗ (т.е. без расширяния и изменения интерфейсоф), это предлагается осуществить из Observer-а или классов-подписчиков?
+
+
+1. Я попытался несколько улучшить исходный дизайн, использовав механизм исключений, вместо кодов возврата. Мотивировка следующая:
+
+a) использование кодов возврата это c-style
+b) использование кодов возврата в функциях, подобных get ломает семантику программы (get все-же должен возвращать значение того, что запрашивает, а не код ошибки)
+c) то же относится к передаче значений по неконстантной ссылке или передаче указателя на заранее выделенный внешний буффер. Это все усложнение семантики, усложнение интерфейсов и, тем самым, путь к ошибкам в программе.
+
+
+
+"событие HWM и LWM должно генерироваться только один раз при достижении соответствующего барьера и приводить к блокировке (разблокировке) писателей; не должно генерироваться два (или более) подряд сообщений HWM (или LWM)"
+
+Мне непонятна логика, описанная в данном утверждении. Если HWM должно генерироваться только один раз, это означает, что его проверка должна производиться ДО вставки в очередь. А если это так, то какой смысл вводить max_size больший чем HWM? По факту, мы НИКОГДА не сможем превысить HWM. Это так и задумано? Почему же тогда hwm выставляется в 90 процентов от max_size?
+
+
+В исходном задании описан синхронный метод get. Я счел более логичным сделать асинхронные метод get. В самом деле, пусть прикладной код (класс Reader в нашем случае) сам решает, как быть, если очередь пуста
+
+Использование IMessageQueueEvents как класса-стратегии для настройки работы MessageQueue не самая удачная мысль. Собственно, моя логика была такова:
+
+a) если это класс-стратегия, то какие аспекты поведения в него выносятся? Мне приходит в голову только один вариант - быть синхронным/асинхронным при добавлении нового сообщения.
+b) выносить подобное поведение в стратегию несколько странно. Чтобы реализовать класс-стратегию для синхронного добавления сообщений в очередь, понадобится либо вводить в него дополнительный мьютекс и кондишен, что есть оверхед; либо расширять исходный интерфейс класса-стратегии, чтобы передать в него информацию о хост-классе: ссылку на мьютекс (на котором мы уснем в ожидании на кондишене) или бэк-референс на хост-класс (чтобы использовать какой-нибудь дополнительный интерфейс хост-класса, реализующий подобное поведение). Оба пути выглядят сомнительными с точки зрения удачности проектного решения.
+c) даже если предположить, что это класс-стратегия, то ей лучше быть compile-time стратегией (параметром шаблона хост-класса, реализующим необходимый функционал), чтобы исключить возможность изменения поведения на лету. Поскольку любой поток, имеющий доступ к объекту типа MessageQueue, согласно спецификации, имеет возможность в любое время изменить используемую им политику, что приведет к изменению поведения читателей и писателе, что, как минимум, странно.
+
+Использование IMessageQueueEvents для реализации шаблона Observer вообще нереально в рамках описанных в ТЗ интерфейсов. Для этого надо дополнить его четырьмя методами subscribe для соответствующих сигналов и передавать инстанс данного класса каждому из Writer-ов, чтобы те подписывали свои внутренние методы на соответствующий сигнал.
+
+Таким образом, я сделал вывод, что IMessageQueueEvents это интерфейс, реализующий шаблон Decorator, а не Policy.
+
+
+2. Здесь эксперты ошибаются. Вывод в cout на самом деле синхронизирован, поскольку методы класса IMessageQueueEvents даргаются из под залоченного мьютекса в методах put и get класса MessageQueue.
+
+Чтобы решить эту проблему, придется либо наследовать Writer и Reader от приватной базы со статическим мьютексом (чтобы не мусорить в глобальном пространстве имен), что не является ни красивым, ни расширяемым решением. Либо писать дополнительный примитив, опосредующий работу с потоком вывода, что я посчитал излишним в рамках небольшого тестового задания.
+Однако, ок. Исправляюсь. Добавляю класс lwl::logger
+
+3. Должно быть, Вы имели в виду конструктор класса Reader. Здесь explicit остался по недосмотру от одной из первых реализаций и может быть удален. В классе MessageQueue explicit необходим, чтобы предотвратить неявное автоматическое приведение переменной типа size_t к MessageQueue при случайном использовании его в контексте последнего. Конструктор принимает три параметра, два из которых имеют дефолтные значения, а стало быть это (без использования explicit) конструктор преобразования.
+
+4. В задании не описано, что должен сделать Writer при переполнении очереди (НЕ при превышении hwl)? Поскольку в тестовом задании классы Writer и Reader предназначены лишь для демонстрации поведения класса MessageQueue, то я предположил вполне достаточным использовать в данном случае assert-утвреждение (поскольку в тесте недостаточно Writer-ов, чтобы переполнить очередь с данным lwm). С тем же успехом можно прекратить поток, подождать на еще одном дополнительном кондишене, подождать в sleep по таймауту, игнорировать исключение, перейдя к следующей итерации и попытке положить сообщение в очередь и т.д. В любом случае, данная логика остается на усмотрение прикладного класса Writer и не имеет отношения к устройству MessageQueue. Задача последнего, лишь уведомить о данном состоянии.
+При достижении LWM разблокировался лишь один поток для того, чтобы плавно наращивать нагрузку
Property changes on: gentoo-configs/mutanabbi/common/home/radja/docs/zodiac.txt
___________________________________________________________________
Added: svn:keywords
+ Id HeadURL Revision Date Author
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|